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
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
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;
|
|
|
|
GtkWidget *button;
|
|
|
|
|
1999-11-08 20:14:59 +00:00
|
|
|
/* FIXME: This is not allowable - what is this supposed to be? */
|
|
|
|
/* gdk_progclass = g_strdup ("XTerm"); */
|
1997-11-24 22:37:52 +00:00
|
|
|
gtk_init (&argc, &argv);
|
2001-03-07 14:49:21 +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 (),
|
2001-03-07 14:49:21 +00:00
|
|
|
"user_data", NULL,
|
|
|
|
"type", GTK_WINDOW_TOPLEVEL,
|
|
|
|
"title", "hello world",
|
2010-08-07 15:07:17 +00:00
|
|
|
"resizable", FALSE,
|
2001-03-07 14:49:21 +00:00
|
|
|
"border_width", 10,
|
|
|
|
NULL),
|
|
|
|
"signal::destroy", gtk_main_quit, NULL,
|
|
|
|
NULL);
|
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
|
|
|
button = g_object_connect (g_object_new (gtk_button_get_type (),
|
2001-03-07 14:49:21 +00:00
|
|
|
"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;
|
|
|
|
}
|