2005-07-13 05:44:22 +00:00
|
|
|
/* simple.c
|
|
|
|
* Copyright (C) 1997 Red Hat, Inc
|
|
|
|
* Author: Elliot Lee
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
2012-02-27 13:01:10 +00:00
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
2005-07-13 05:44:22 +00:00
|
|
|
*/
|
2008-06-22 14:28:52 +00:00
|
|
|
#include "config.h"
|
1997-11-24 22:37:52 +00:00
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
|
|
|
|
|
|
|
void
|
1998-05-03 22:41:32 +00:00
|
|
|
hello (void)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
g_print ("hello world\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
main (int argc, char *argv[])
|
|
|
|
{
|
|
|
|
GtkWidget *window;
|
|
|
|
|
2016-12-28 13:53:22 +00:00
|
|
|
gtk_init ();
|
2011-02-12 04:59:42 +00:00
|
|
|
|
Use g_object_new instead of gtk_widget_new
2008-06-19 Johan Dahlin <jdahlin@async.com.br>
* demos/testpixbuf.c (new_testrgb_window):
* gtk/gtkctree.c (gtk_ctree_new_with_titles):
* gtk/gtkitemfactory.c (gtk_item_factory_construct),
(gtk_item_factory_create_item):
* gtk/gtkmenu.c (gtk_menu_set_tearoff_state):
* gtk/gtkprogressbar.c (gtk_progress_bar_new),
(gtk_progress_bar_new_with_adjustment):
* gtk/gtkscrolledwindow.c (gtk_scrolled_window_new):
* gtk/gtktext.c (gtk_text_new):
* gtk/gtkviewport.c (gtk_viewport_new):
* tests/simple.c (main):
* tests/testgtk.c (create_statusbar), (create_get_image),
(create_saved_position), (create_tooltips), (create_cursors),
(create_display_screen), (create_progress_bar), (create_idle_test):
* tests/testmultidisplay.c (make_selection_dialog), (main):
* tests/testmultiscreen.c (main):
* tests/testrgb.c (new_testrgb_window):
Use g_object_new instead of gtk_widget_new
svn path=/trunk/; revision=20462
2008-06-19 12:25:19 +00:00
|
|
|
window = g_object_connect (g_object_new (gtk_window_get_type (),
|
2011-02-12 04:59:42 +00:00
|
|
|
"type", GTK_WINDOW_TOPLEVEL,
|
|
|
|
"title", "hello world",
|
|
|
|
"resizable", FALSE,
|
|
|
|
NULL),
|
|
|
|
"signal::destroy", gtk_main_quit, NULL,
|
|
|
|
NULL);
|
|
|
|
g_object_connect (g_object_new (gtk_button_get_type (),
|
|
|
|
"GtkButton::label", "hello world",
|
|
|
|
"GtkWidget::parent", window,
|
|
|
|
"GtkWidget::visible", TRUE,
|
|
|
|
NULL),
|
|
|
|
"signal::clicked", hello, NULL,
|
|
|
|
NULL);
|
1997-11-24 22:37:52 +00:00
|
|
|
gtk_widget_show (window);
|
|
|
|
|
|
|
|
gtk_main ();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|