diff options
author | GMT 1999 Tony Gale <gale@gtk.org> | 1999-01-28 10:35:40 +0000 |
---|---|---|
committer | Tony Gale <gale@src.gnome.org> | 1999-01-28 10:35:40 +0000 |
commit | a2dafdfc88dbaaaf67c3971372da4a5b8b63ec2b (patch) | |
tree | b16f8940a58bbe8d25bcf5f3112fbcb3c682952b /examples | |
parent | a70005873773b8b3214b2a54818990db517fbaa9 (diff) | |
download | gdk-pixbuf-a2dafdfc88dbaaaf67c3971372da4a5b8b63ec2b.tar.gz |
- Replace all uses of deprecated functions. - Replace menufactory example
Thu Jan 28 10:16:28 GMT 1999 Tony Gale <gale@gtk.org>
* docs/gtk_tut.sgml:
- Replace all uses of deprecated functions.
- Replace menufactory example with itemfactory example
from Nick Scott <mendigo@geocities.com>
- Minor bug fixes in the examples.
Diffstat (limited to 'examples')
29 files changed, 64 insertions, 209 deletions
diff --git a/examples/aspectframe/aspectframe.c b/examples/aspectframe/aspectframe.c index f82e0276a..021673073 100644 --- a/examples/aspectframe/aspectframe.c +++ b/examples/aspectframe/aspectframe.c @@ -14,7 +14,7 @@ main (int argc, char *argv[]) gtk_window_set_title (GTK_WINDOW (window), "Aspect Frame"); gtk_signal_connect (GTK_OBJECT (window), "destroy", GTK_SIGNAL_FUNC (gtk_main_quit), NULL); - gtk_container_border_width (GTK_CONTAINER (window), 10); + gtk_container_set_border_width (GTK_CONTAINER (window), 10); /* Create an aspect_frame and add it to our toplevel window */ diff --git a/examples/buttons/buttons.c b/examples/buttons/buttons.c index e6eb5561a..1dc2fd418 100644 --- a/examples/buttons/buttons.c +++ b/examples/buttons/buttons.c @@ -18,7 +18,7 @@ GtkWidget *xpm_label_box( GtkWidget *parent, /* Create box for xpm and label */ box1 = gtk_hbox_new (FALSE, 0); - gtk_container_border_width (GTK_CONTAINER (box1), 2); + gtk_container_set_border_width (GTK_CONTAINER (box1), 2); /* Get the style of the button to get the * background color. */ @@ -77,7 +77,7 @@ int main( int argc, /* Sets the border width of the window. */ - gtk_container_border_width (GTK_CONTAINER (window), 10); + gtk_container_set_border_width (GTK_CONTAINER (window), 10); gtk_widget_realize(window); /* Create a new button */ diff --git a/examples/clist/clist.c b/examples/clist/clist.c index 69a252dee..7068dcae5 100644 --- a/examples/clist/clist.c +++ b/examples/clist/clist.c @@ -31,7 +31,7 @@ gint main (int argc, gchar *argv[]) NULL); vbox=gtk_vbox_new(FALSE, 5); - gtk_container_border_width(GTK_CONTAINER(vbox), 5); + gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); gtk_container_add(GTK_CONTAINER(window), vbox); gtk_widget_show(vbox); diff --git a/examples/entry/entry.c b/examples/entry/entry.c index 7d41048e4..510f5e216 100644 --- a/examples/entry/entry.c +++ b/examples/entry/entry.c @@ -64,14 +64,14 @@ int main (int argc, char *argv[]) gtk_box_pack_start (GTK_BOX (hbox), check, TRUE, TRUE, 0); gtk_signal_connect (GTK_OBJECT(check), "toggled", GTK_SIGNAL_FUNC(entry_toggle_editable), entry); - gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(check), TRUE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check), TRUE); gtk_widget_show (check); check = gtk_check_button_new_with_label("Visible"); gtk_box_pack_start (GTK_BOX (hbox), check, TRUE, TRUE, 0); gtk_signal_connect (GTK_OBJECT(check), "toggled", GTK_SIGNAL_FUNC(entry_toggle_visibility), entry); - gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(check), TRUE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check), TRUE); gtk_widget_show (check); button = gtk_button_new_with_label ("Close"); diff --git a/examples/eventbox/eventbox.c b/examples/eventbox/eventbox.c index b902cc1f4..f6b34bb3b 100644 --- a/examples/eventbox/eventbox.c +++ b/examples/eventbox/eventbox.c @@ -18,7 +18,7 @@ main (int argc, char *argv[]) gtk_signal_connect (GTK_OBJECT (window), "destroy", GTK_SIGNAL_FUNC (gtk_exit), NULL); - gtk_container_border_width (GTK_CONTAINER (window), 10); + gtk_container_set_border_width (GTK_CONTAINER (window), 10); /* Create an EventBox and add it to our toplevel window */ @@ -49,6 +49,6 @@ main (int argc, char *argv[]) gtk_main (); - return 0; + return(0); } /* example-end */ diff --git a/examples/helloworld/helloworld.c b/examples/helloworld/helloworld.c index baa0b6040..062252ddf 100644 --- a/examples/helloworld/helloworld.c +++ b/examples/helloworld/helloworld.c @@ -64,7 +64,7 @@ int main( int argc, GTK_SIGNAL_FUNC (destroy), NULL); /* Sets the border width of the window. */ - gtk_container_border_width (GTK_CONTAINER (window), 10); + gtk_container_set_border_width (GTK_CONTAINER (window), 10); /* Creates a new button with the label "Hello World". */ button = gtk_button_new_with_label ("Hello World"); diff --git a/examples/helloworld2/helloworld2.c b/examples/helloworld2/helloworld2.c index 6954333a5..a525aa3eb 100644 --- a/examples/helloworld2/helloworld2.c +++ b/examples/helloworld2/helloworld2.c @@ -43,7 +43,7 @@ int main( int argc, GTK_SIGNAL_FUNC (delete_event), NULL); /* Sets the border width of the window. */ - gtk_container_border_width (GTK_CONTAINER (window), 10); + gtk_container_set_border_width (GTK_CONTAINER (window), 10); /* We create a box to pack widgets into. This is described in detail * in the "packing" section. The box is not really visible, it diff --git a/examples/list/list.c b/examples/list/list.c index 2cc4092b2..0a7147dc6 100644 --- a/examples/list/list.c +++ b/examples/list/list.c @@ -61,7 +61,7 @@ gint main (int argc, /* Inside the window we need a box to arrange the widgets * vertically */ vbox=gtk_vbox_new(FALSE, 5); - gtk_container_border_width(GTK_CONTAINER(vbox), 5); + gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); gtk_container_add(GTK_CONTAINER(window), vbox); gtk_widget_show(vbox); @@ -88,7 +88,7 @@ gint main (int argc, /* We create a "Prison" to put a list item in ;) */ frame=gtk_frame_new("Prison"); gtk_widget_set_usize(frame, 200, 50); - gtk_container_border_width(GTK_CONTAINER(frame), 5); + gtk_container_set_border_width(GTK_CONTAINER(frame), 5); gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_OUT); gtk_container_add(GTK_CONTAINER(vbox), frame); gtk_widget_show(frame); diff --git a/examples/menu/Makefile b/examples/menu/Makefile index b9db74f44..4b94bb99b 100644 --- a/examples/menu/Makefile +++ b/examples/menu/Makefile @@ -1,19 +1,13 @@ CC = gcc -all: menu menufactory +all: menu itemfactory menu: menu.c $(CC) `gtk-config --cflags` menu.c -o menu `gtk-config --libs` -menufactory: menufactory.o mfmain.o - $(CC) `gtk-config --libs` menufactory.o mfmain.o -o menufactory - -menufactory.o: menufactory.c mfmain.h - $(CC) `gtk-config --cflags` -c menufactory.c -o menufactory.o - -mfmain.o: mfmain.c mfmain.h menufactory.h - $(CC) `gtk-config --cflags` -c mfmain.c -o mfmain.o +itemfactory: itemfactory.c + $(CC) `gtk-config --cflags` itemfactory.c -o itemfactory `gtk-config --libs` clean: - rm -f *.o menu menufactory + rm -f *.o menu itemfactory diff --git a/examples/menu/menufactory.c b/examples/menu/menufactory.c deleted file mode 100644 index a7f781959..000000000 --- a/examples/menu/menufactory.c +++ /dev/null @@ -1,54 +0,0 @@ -/* example-start menu menufactory.c */ - -#include <gtk/gtk.h> -#include <strings.h> - -#include "mfmain.h" - -static void print_hello(GtkWidget *widget, gpointer data); - - -/* this is the GtkMenuEntry structure used to create new menus. The - * first member is the menu definition string. The second, the - * default accelerator key used to access this menu function with - * the keyboard. The third is the callback function to call when - * this menu item is selected (by the accelerator key, or with the - * mouse.) The last member is the data to pass to your callback function. - */ - -static GtkMenuEntry menu_items[] = -{ - {"<Main>/File/New", "<control>N", print_hello, NULL}, - {"<Main>/File/Open", "<control>O", print_hello, NULL}, - {"<Main>/File/Save", "<control>S", print_hello, NULL}, - {"<Main>/File/Save as", NULL, NULL, NULL}, - {"<Main>/File/<separator>", NULL, NULL, NULL}, - {"<Main>/File/Quit", "<control>Q", file_quit_cmd_callback, "OK, I'll quit"}, - {"<Main>/Options/Test", NULL, NULL, NULL} -}; - - -static void -print_hello(GtkWidget *widget, gpointer data) -{ - printf("hello!\n"); -} - -void get_main_menu(GtkWidget *window, GtkWidget ** menubar) -{ - int nmenu_items = sizeof(menu_items) / sizeof(menu_items[0]); - GtkMenuFactory *factory; - GtkMenuFactory *subfactory; - - factory = gtk_menu_factory_new(GTK_MENU_FACTORY_MENU_BAR); - subfactory = gtk_menu_factory_new(GTK_MENU_FACTORY_MENU_BAR); - - gtk_menu_factory_add_subfactory(factory, subfactory, "<Main>"); - gtk_menu_factory_add_entries(factory, menu_items, nmenu_items); - gtk_window_add_accelerator_table(GTK_WINDOW(window), subfactory->table); - - if (menubar) - *menubar = subfactory->widget; -} - -/* example-end */ diff --git a/examples/menu/menufactory.h b/examples/menu/menufactory.h deleted file mode 100644 index acd04684e..000000000 --- a/examples/menu/menufactory.h +++ /dev/null @@ -1,18 +0,0 @@ -/* example-start menu menufactory.h */ - -#ifndef __MENUFACTORY_H__ -#define __MENUFACTORY_H__ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -void get_main_menu (GtkWidget *, GtkWidget **menubar); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __MENUFACTORY_H__ */ - -/* example-end */ diff --git a/examples/menu/mfmain.c b/examples/menu/mfmain.c deleted file mode 100644 index 5777632ee..000000000 --- a/examples/menu/mfmain.c +++ /dev/null @@ -1,48 +0,0 @@ -/* example-start menu mfmain.c */ - -#include <gtk/gtk.h> - -#include "mfmain.h" -#include "menufactory.h" - -int main(int argc, char *argv[]) -{ - GtkWidget *window; - GtkWidget *main_vbox; - GtkWidget *menubar; - - gtk_init(&argc, &argv); - - window = gtk_window_new(GTK_WINDOW_TOPLEVEL); - gtk_signal_connect(GTK_OBJECT(window), "destroy", - GTK_SIGNAL_FUNC(file_quit_cmd_callback), - "WM destroy"); - gtk_window_set_title(GTK_WINDOW(window), "Menu Factory"); - gtk_widget_set_usize(GTK_WIDGET(window), 300, 200); - - main_vbox = gtk_vbox_new(FALSE, 1); - gtk_container_border_width(GTK_CONTAINER(main_vbox), 1); - gtk_container_add(GTK_CONTAINER(window), main_vbox); - gtk_widget_show(main_vbox); - - get_main_menu(window, &menubar); - gtk_box_pack_start(GTK_BOX(main_vbox), menubar, FALSE, TRUE, 0); - gtk_widget_show(menubar); - - gtk_widget_show(window); - gtk_main(); - - return(0); -} - -/* This is just to demonstrate how callbacks work when using the - * menufactory. Often, people put all the callbacks from the menus - * in a separate file, and then have them call the appropriate functions - * from there. Keeps it more organized. */ -void file_quit_cmd_callback (GtkWidget *widget, gpointer data) -{ - g_print ("%s\n", (char *) data); - gtk_exit(0); -} - -/* example-end */ diff --git a/examples/menu/mfmain.h b/examples/menu/mfmain.h deleted file mode 100644 index 83fc0e3a4..000000000 --- a/examples/menu/mfmain.h +++ /dev/null @@ -1,19 +0,0 @@ -/* example-start menu mfmain.h */ - -#ifndef __MFMAIN_H__ -#define __MFMAIN_H__ - - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -void file_quit_cmd_callback(GtkWidget *widget, gpointer data); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __MFMAIN_H__ */ - -/* example-end */ diff --git a/examples/notebook/notebook.c b/examples/notebook/notebook.c index f1c8a4767..3cb1007dc 100644 --- a/examples/notebook/notebook.c +++ b/examples/notebook/notebook.c @@ -59,7 +59,7 @@ int main (int argc, char *argv[]) gtk_signal_connect (GTK_OBJECT (window), "delete_event", GTK_SIGNAL_FUNC (delete), NULL); - gtk_container_border_width (GTK_CONTAINER (window), 10); + gtk_container_set_border_width (GTK_CONTAINER (window), 10); table = gtk_table_new(3,6,FALSE); gtk_container_add (GTK_CONTAINER (window), table); @@ -76,7 +76,7 @@ int main (int argc, char *argv[]) sprintf(bufferl, "Page %d", i+1); frame = gtk_frame_new (bufferf); - gtk_container_border_width (GTK_CONTAINER (frame), 10); + gtk_container_set_border_width (GTK_CONTAINER (frame), 10); gtk_widget_set_usize (frame, 100, 75); gtk_widget_show (frame); @@ -102,7 +102,7 @@ int main (int argc, char *argv[]) sprintf(bufferl, "PPage %d", i+1); frame = gtk_frame_new (bufferf); - gtk_container_border_width (GTK_CONTAINER (frame), 10); + gtk_container_set_border_width (GTK_CONTAINER (frame), 10); gtk_widget_set_usize (frame, 100, 75); gtk_widget_show (frame); @@ -139,22 +139,22 @@ int main (int argc, char *argv[]) gtk_widget_show(button); button = gtk_button_new_with_label ("tab position"); - gtk_signal_connect_object (GTK_OBJECT (button), "clicked", - (GtkSignalFunc) rotate_book, GTK_OBJECT(notebook)); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + (GtkSignalFunc) rotate_book, GTK_OBJECT(notebook)); gtk_table_attach_defaults(GTK_TABLE(table), button, 3,4,1,2); gtk_widget_show(button); button = gtk_button_new_with_label ("tabs/border on/off"); - gtk_signal_connect_object (GTK_OBJECT (button), "clicked", - (GtkSignalFunc) tabsborder_book, - GTK_OBJECT (notebook)); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + (GtkSignalFunc) tabsborder_book, + GTK_OBJECT (notebook)); gtk_table_attach_defaults(GTK_TABLE(table), button, 4,5,1,2); gtk_widget_show(button); button = gtk_button_new_with_label ("remove page"); - gtk_signal_connect_object (GTK_OBJECT (button), "clicked", - (GtkSignalFunc) remove_book, - GTK_OBJECT(notebook)); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + (GtkSignalFunc) remove_book, + GTK_OBJECT(notebook)); gtk_table_attach_defaults(GTK_TABLE(table), button, 5,6,1,2); gtk_widget_show(button); diff --git a/examples/packbox/packbox.c b/examples/packbox/packbox.c index 111372234..ba67b9505 100644 --- a/examples/packbox/packbox.c +++ b/examples/packbox/packbox.c @@ -96,7 +96,7 @@ int main( int argc, * behavior */ gtk_signal_connect (GTK_OBJECT (window), "delete_event", GTK_SIGNAL_FUNC (delete_event), NULL); - gtk_container_border_width (GTK_CONTAINER (window), 10); + gtk_container_set_border_width (GTK_CONTAINER (window), 10); /* We create a vertical box (vbox) to pack the horizontal boxes into. * This allows us to stack the horizontal boxes filled with buttons one diff --git a/examples/paned/paned.c b/examples/paned/paned.c index 249d568ae..3cd0e7fa8 100644 --- a/examples/paned/paned.c +++ b/examples/paned/paned.c @@ -114,7 +114,7 @@ main (int argc, char *argv[]) gtk_window_set_title (GTK_WINDOW (window), "Paned Windows"); gtk_signal_connect (GTK_OBJECT (window), "destroy", GTK_SIGNAL_FUNC (gtk_main_quit), NULL); - gtk_container_border_width (GTK_CONTAINER (window), 10); + gtk_container_set_border_width (GTK_CONTAINER (window), 10); gtk_widget_set_usize (GTK_WIDGET(window), 450, 400); /* create a vpaned widget and add it to our toplevel window */ diff --git a/examples/pixmap/pixmap.c b/examples/pixmap/pixmap.c index 6e0607a2a..bb48c4183 100644 --- a/examples/pixmap/pixmap.c +++ b/examples/pixmap/pixmap.c @@ -54,7 +54,7 @@ int main( int argc, char *argv[] ) window = gtk_window_new( GTK_WINDOW_TOPLEVEL ); gtk_signal_connect( GTK_OBJECT (window), "delete_event", GTK_SIGNAL_FUNC (close_application), NULL ); - gtk_container_border_width( GTK_CONTAINER (window), 10 ); + gtk_container_set_border_width( GTK_CONTAINER (window), 10 ); gtk_widget_show( window ); /* now for the pixmap from gdk */ diff --git a/examples/radiobuttons/radiobuttons.c b/examples/radiobuttons/radiobuttons.c index 2b1263e8b..4f708c95c 100644 --- a/examples/radiobuttons/radiobuttons.c +++ b/examples/radiobuttons/radiobuttons.c @@ -29,14 +29,14 @@ int main( int argc, NULL); gtk_window_set_title (GTK_WINDOW (window), "radio buttons"); - gtk_container_border_width (GTK_CONTAINER (window), 0); + gtk_container_set_border_width (GTK_CONTAINER (window), 0); box1 = gtk_vbox_new (FALSE, 0); gtk_container_add (GTK_CONTAINER (window), box1); gtk_widget_show (box1); box2 = gtk_vbox_new (FALSE, 10); - gtk_container_border_width (GTK_CONTAINER (box2), 10); + gtk_container_set_border_width (GTK_CONTAINER (box2), 10); gtk_box_pack_start (GTK_BOX (box1), box2, TRUE, TRUE, 0); gtk_widget_show (box2); @@ -46,7 +46,7 @@ int main( int argc, group = gtk_radio_button_group (GTK_RADIO_BUTTON (button)); button = gtk_radio_button_new_with_label(group, "button2"); - gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (button), TRUE); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE); gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0); gtk_widget_show (button); @@ -61,7 +61,7 @@ int main( int argc, gtk_widget_show (separator); box2 = gtk_vbox_new (FALSE, 10); - gtk_container_border_width (GTK_CONTAINER (box2), 10); + gtk_container_set_border_width (GTK_CONTAINER (box2), 10); gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, TRUE, 0); gtk_widget_show (box2); diff --git a/examples/rangewidgets/rangewidgets.c b/examples/rangewidgets/rangewidgets.c index 886200bd2..72d2f5467 100644 --- a/examples/rangewidgets/rangewidgets.c +++ b/examples/rangewidgets/rangewidgets.c @@ -98,7 +98,7 @@ void create_range_controls( void ) gtk_widget_show (box1); box2 = gtk_hbox_new (FALSE, 10); - gtk_container_border_width (GTK_CONTAINER (box2), 10); + gtk_container_set_border_width (GTK_CONTAINER (box2), 10); gtk_box_pack_start (GTK_BOX (box1), box2, TRUE, TRUE, 0); gtk_widget_show (box2); @@ -134,20 +134,20 @@ void create_range_controls( void ) gtk_widget_show (scrollbar); box2 = gtk_hbox_new (FALSE, 10); - gtk_container_border_width (GTK_CONTAINER (box2), 10); + gtk_container_set_border_width (GTK_CONTAINER (box2), 10); gtk_box_pack_start (GTK_BOX (box1), box2, TRUE, TRUE, 0); gtk_widget_show (box2); /* A checkbutton to control whether the value is displayed or not */ button = gtk_check_button_new_with_label("Display value on scale widgets"); - gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (button), TRUE); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE); gtk_signal_connect (GTK_OBJECT (button), "toggled", GTK_SIGNAL_FUNC(cb_draw_value), NULL); gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0); gtk_widget_show (button); box2 = gtk_hbox_new (FALSE, 10); - gtk_container_border_width (GTK_CONTAINER (box2), 10); + gtk_container_set_border_width (GTK_CONTAINER (box2), 10); /* An option menu to change the position of the value */ label = gtk_label_new ("Scale Value Position:"); @@ -182,7 +182,7 @@ void create_range_controls( void ) gtk_widget_show (box2); box2 = gtk_hbox_new (FALSE, 10); - gtk_container_border_width (GTK_CONTAINER (box2), 10); + gtk_container_set_border_width (GTK_CONTAINER (box2), 10); /* Yet another option menu, this time for the update policy of the * scale widgets */ @@ -216,7 +216,7 @@ void create_range_controls( void ) gtk_widget_show (box2); box2 = gtk_hbox_new (FALSE, 10); - gtk_container_border_width (GTK_CONTAINER (box2), 10); + gtk_container_set_border_width (GTK_CONTAINER (box2), 10); /* A GtkHScale widget for adjusting the number of digits on the * sample scales. */ @@ -236,7 +236,7 @@ void create_range_controls( void ) gtk_widget_show (box2); box2 = gtk_hbox_new (FALSE, 10); - gtk_container_border_width (GTK_CONTAINER (box2), 10); + gtk_container_set_border_width (GTK_CONTAINER (box2), 10); /* And, one last GtkHScale widget for adjusting the page size of the * scrollbar. */ @@ -260,7 +260,7 @@ void create_range_controls( void ) gtk_widget_show (separator); box2 = gtk_vbox_new (FALSE, 10); - gtk_container_border_width (GTK_CONTAINER (box2), 10); + gtk_container_set_border_width (GTK_CONTAINER (box2), 10); gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, TRUE, 0); gtk_widget_show (box2); diff --git a/examples/rulers/rulers.c b/examples/rulers/rulers.c index 014d6be22..41260c6bc 100644 --- a/examples/rulers/rulers.c +++ b/examples/rulers/rulers.c @@ -22,7 +22,7 @@ int main( int argc, char *argv[] ) { window = gtk_window_new( GTK_WINDOW_TOPLEVEL ); gtk_signal_connect (GTK_OBJECT (window), "delete_event", GTK_SIGNAL_FUNC( close_application ), NULL); - gtk_container_border_width (GTK_CONTAINER (window), 10); + gtk_container_set_border_width (GTK_CONTAINER (window), 10); /* Create a table for placing the ruler and the drawing area */ table = gtk_table_new( 3, 2, FALSE ); diff --git a/examples/scrolledwin/scrolledwin.c b/examples/scrolledwin/scrolledwin.c index 29df87a9d..8521b8366 100644 --- a/examples/scrolledwin/scrolledwin.c +++ b/examples/scrolledwin/scrolledwin.c @@ -26,13 +26,13 @@ int main (int argc, char *argv[]) gtk_signal_connect (GTK_OBJECT (window), "destroy", (GtkSignalFunc) destroy, NULL); gtk_window_set_title (GTK_WINDOW (window), "GtkScrolledWindow example"); - gtk_container_border_width (GTK_CONTAINER (window), 0); + gtk_container_set_border_width (GTK_CONTAINER (window), 0); gtk_widget_set_usize(window, 300, 300); /* create a new scrolled window. */ scrolled_window = gtk_scrolled_window_new (NULL, NULL); - gtk_container_border_width (GTK_CONTAINER (scrolled_window), 10); + gtk_container_set_border_width (GTK_CONTAINER (scrolled_window), 10); /* the policy is one of GTK_POLICY AUTOMATIC, or GTK_POLICY_ALWAYS. * GTK_POLICY_AUTOMATIC will automatically decide whether you need diff --git a/examples/selection/gettargets.c b/examples/selection/gettargets.c index 433cab21e..fa183b597 100644 --- a/examples/selection/gettargets.c +++ b/examples/selection/gettargets.c @@ -72,7 +72,7 @@ main (int argc, char *argv[]) window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (window), "Event Box"); - gtk_container_border_width (GTK_CONTAINER (window), 10); + gtk_container_set_border_width (GTK_CONTAINER (window), 10); gtk_signal_connect (GTK_OBJECT (window), "destroy", GTK_SIGNAL_FUNC (gtk_exit), NULL); diff --git a/examples/selection/setselection.c b/examples/selection/setselection.c index 2f8532b10..fcde84b2d 100644 --- a/examples/selection/setselection.c +++ b/examples/selection/setselection.c @@ -15,7 +15,7 @@ selection_toggled (GtkWidget *widget, gint *have_selection) /* if claiming the selection failed, we return the button to the out state */ if (!*have_selection) - gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON(widget), FALSE); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(widget), FALSE); } else { @@ -37,7 +37,7 @@ selection_clear (GtkWidget *widget, GdkEventSelection *event, gint *have_selection) { *have_selection = FALSE; - gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON(widget), FALSE); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(widget), FALSE); return TRUE; } @@ -75,7 +75,7 @@ main (int argc, char *argv[]) window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (window), "Event Box"); - gtk_container_border_width (GTK_CONTAINER (window), 10); + gtk_container_set_border_width (GTK_CONTAINER (window), 10); gtk_signal_connect (GTK_OBJECT (window), "destroy", GTK_SIGNAL_FUNC (gtk_exit), NULL); diff --git a/examples/statusbar/statusbar.c b/examples/statusbar/statusbar.c index 7956ffdec..2a4e8cf8a 100644 --- a/examples/statusbar/statusbar.c +++ b/examples/statusbar/statusbar.c @@ -11,14 +11,14 @@ void push_item (GtkWidget *widget, gpointer data) char buff[20]; g_snprintf(buff, 20, "Item %d", count++); - gtk_statusbar_push( GTK_STATUSBAR(status_bar), (guint) &data, buff); + gtk_statusbar_push( GTK_STATUSBAR(status_bar), GPOINTER_TO_INT(data), buff); return; } void pop_item (GtkWidget *widget, gpointer data) { - gtk_statusbar_pop( GTK_STATUSBAR(status_bar), (guint) &data ); + gtk_statusbar_pop( GTK_STATUSBAR(status_bar), GPOINTER_TO_INT(data) ); return; } @@ -29,7 +29,7 @@ int main (int argc, char *argv[]) GtkWidget *vbox; GtkWidget *button; - int context_id; + gint context_id; gtk_init (&argc, &argv); @@ -52,13 +52,13 @@ int main (int argc, char *argv[]) button = gtk_button_new_with_label("push item"); gtk_signal_connect(GTK_OBJECT(button), "clicked", - GTK_SIGNAL_FUNC (push_item), &context_id); + GTK_SIGNAL_FUNC (push_item), GINT_TO_POINTER(context_id) ); gtk_box_pack_start(GTK_BOX(vbox), button, TRUE, TRUE, 2); gtk_widget_show(button); button = gtk_button_new_with_label("pop last item"); gtk_signal_connect(GTK_OBJECT(button), "clicked", - GTK_SIGNAL_FUNC (pop_item), &context_id); + GTK_SIGNAL_FUNC (pop_item), GINT_TO_POINTER(context_id) ); gtk_box_pack_start(GTK_BOX(vbox), button, TRUE, TRUE, 2); gtk_widget_show(button); diff --git a/examples/table/table.c b/examples/table/table.c index 662450c0d..dbd9aad87 100644 --- a/examples/table/table.c +++ b/examples/table/table.c @@ -39,7 +39,7 @@ int main( int argc, GTK_SIGNAL_FUNC (delete_event), NULL); /* Sets the border width of the window. */ - gtk_container_border_width (GTK_CONTAINER (window), 20); + gtk_container_set_border_width (GTK_CONTAINER (window), 20); /* Create a 2x2 table */ table = gtk_table_new (2, 2, TRUE); diff --git a/examples/text/text.c b/examples/text/text.c index b6a021018..f98ba09c0 100644 --- a/examples/text/text.c +++ b/examples/text/text.c @@ -51,7 +51,7 @@ int main (int argc, char *argv[]) GTK_SIGNAL_FUNC(close_application), NULL); gtk_window_set_title (GTK_WINDOW (window), "Text Widget Example"); - gtk_container_border_width (GTK_CONTAINER (window), 0); + gtk_container_set_border_width (GTK_CONTAINER (window), 0); box1 = gtk_vbox_new (FALSE, 0); @@ -60,7 +60,7 @@ int main (int argc, char *argv[]) box2 = gtk_vbox_new (FALSE, 10); - gtk_container_border_width (GTK_CONTAINER (box2), 10); + gtk_container_set_border_width (GTK_CONTAINER (box2), 10); gtk_box_pack_start (GTK_BOX (box1), box2, TRUE, TRUE, 0); gtk_widget_show (box2); @@ -145,13 +145,13 @@ int main (int argc, char *argv[]) gtk_box_pack_start (GTK_BOX (hbox), check, FALSE, FALSE, 0); gtk_signal_connect (GTK_OBJECT(check), "toggled", GTK_SIGNAL_FUNC(text_toggle_editable), text); - gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(check), TRUE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check), TRUE); gtk_widget_show (check); check = gtk_check_button_new_with_label("Wrap Words"); gtk_box_pack_start (GTK_BOX (hbox), check, FALSE, TRUE, 0); gtk_signal_connect (GTK_OBJECT(check), "toggled", GTK_SIGNAL_FUNC(text_toggle_word_wrap), text); - gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(check), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check), FALSE); gtk_widget_show (check); separator = gtk_hseparator_new (); @@ -159,7 +159,7 @@ int main (int argc, char *argv[]) gtk_widget_show (separator); box2 = gtk_vbox_new (FALSE, 10); - gtk_container_border_width (GTK_CONTAINER (box2), 10); + gtk_container_set_border_width (GTK_CONTAINER (box2), 10); gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, TRUE, 0); gtk_widget_show (box2); @@ -176,6 +176,6 @@ int main (int argc, char *argv[]) gtk_main (); - return 0; + return(0); } /* example-end */ diff --git a/examples/tictactoe/tictactoe.c b/examples/tictactoe/tictactoe.c index 93b1633ad..530d72e3d 100644 --- a/examples/tictactoe/tictactoe.c +++ b/examples/tictactoe/tictactoe.c @@ -115,7 +115,7 @@ tictactoe_clear (Tictactoe *ttt) for (j=0;j<3;j++) { gtk_signal_handler_block_by_data (GTK_OBJECT(ttt->buttons[i][j]), ttt); - gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (ttt->buttons[i][j]), + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (ttt->buttons[i][j]), FALSE); gtk_signal_handler_unblock_by_data (GTK_OBJECT(ttt->buttons[i][j]), ttt); } diff --git a/examples/tictactoe/ttt_test.c b/examples/tictactoe/ttt_test.c index a3c413778..4a08248c7 100644 --- a/examples/tictactoe/ttt_test.c +++ b/examples/tictactoe/ttt_test.c @@ -25,7 +25,7 @@ main (int argc, char *argv[]) gtk_signal_connect (GTK_OBJECT (window), "destroy", GTK_SIGNAL_FUNC (gtk_exit), NULL); - gtk_container_border_width (GTK_CONTAINER (window), 10); + gtk_container_set_border_width (GTK_CONTAINER (window), 10); ttt = tictactoe_new (); diff --git a/examples/tree/tree.c b/examples/tree/tree.c index d709300fa..3ac6a4cb2 100644 --- a/examples/tree/tree.c +++ b/examples/tree/tree.c @@ -71,7 +71,7 @@ int main (int argc, char *argv[]) window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_signal_connect (GTK_OBJECT(window), "delete_event", GTK_SIGNAL_FUNC (gtk_main_quit), NULL); - gtk_container_border_width (GTK_CONTAINER(window), 5); + gtk_container_set_border_width (GTK_CONTAINER(window), 5); /* A generic scrolled window */ scrolled_win = gtk_scrolled_window_new (NULL, NULL); |