diff options
author | Matthias Clasen <matthiasc@src.gnome.org> | 2002-02-16 23:52:30 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2002-02-16 23:52:30 +0000 |
commit | b3d5f148e6c0e2cb688403655c7800b762e33602 (patch) | |
tree | 1056439dd24e464adbabc5c374182a886c669345 /examples/list | |
parent | 554838e4f602d59f5be241d1da188934d51d49c3 (diff) | |
download | gtk+-b3d5f148e6c0e2cb688403655c7800b762e33602.tar.gz |
More work on #71430.
* examples/*/Makefile (CFLAGS): add deprecation guards.
* docs/tutorial/gtk-tut.sgml, examples/*/*.c: make most examples
deprecation-clean; the major offenders right now are the examples
that make heavy use of completely deprecated or broken widgets:
list, tree, text, pixmap, paned and progressbar. These will have
to be redone from scratch.
* demos/Makefile.am (INCLUDES): add -DGDK_PIXBUF_DISABLE_DEPRECATED.
Diffstat (limited to 'examples/list')
-rw-r--r-- | examples/list/Makefile | 10 | ||||
-rw-r--r-- | examples/list/list.c | 18 |
2 files changed, 17 insertions, 11 deletions
diff --git a/examples/list/Makefile b/examples/list/Makefile index 33e5765b85..59cc93aa49 100644 --- a/examples/list/Makefile +++ b/examples/list/Makefile @@ -1,8 +1,16 @@ CC = gcc +#CFLAGS = -Wall \ +# -DG_DISABLE_DEPRECATED \ +# -DGDK_DISABLE_DEPRECATED \ +# -DGDK_PIXBUF_DISABLE_DEPRECATED \ +# -DGTK_DISABLE_DEPRECATED + +CFLAGS = + list: list.c - $(CC) `pkg-config --cflags gtk+-2.0` list.c -o list `pkg-config --libs gtk+-2.0` + $(CC) list.c -o list $(CFLAGS) `pkg-config gtk+-2.0 --cflags --libs` clean: rm -f *.o list diff --git a/examples/list/list.c b/examples/list/list.c index 812786bdc0..d797ae3313 100644 --- a/examples/list/list.c +++ b/examples/list/list.c @@ -1,10 +1,9 @@ -/* example-start list list.c */ /* Include the GTK header files * Include stdio.h, we need that for the printf() function */ -#include <gtk/gtk.h> -#include <stdio.h> +#include <gtk/gtk.h> +#include <stdio.h> /* This is our data identification string to store * data in list items @@ -52,7 +51,7 @@ gint main( int argc, */ window=gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_title(GTK_WINDOW(window), "GtkList Example"); - gtk_signal_connect(GTK_OBJECT(window), + g_signal_connect(GTK_OBJECT(window), "destroy", GTK_SIGNAL_FUNC(gtk_main_quit), NULL); @@ -61,13 +60,13 @@ gint main( int argc, /* Inside the window we need a box to arrange the widgets * vertically */ vbox=gtk_vbox_new(FALSE, 5); - gtk_container_set_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); /* This is the scrolled window to put the List widget inside */ scrolled_window=gtk_scrolled_window_new(NULL, NULL); - gtk_widget_set_usize(scrolled_window, 250, 150); + gtk_widget_set_size_request (scrolled_window, 250, 150); gtk_container_add(GTK_CONTAINER(vbox), scrolled_window); gtk_widget_show(scrolled_window); @@ -87,8 +86,8 @@ 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_set_border_width(GTK_CONTAINER(frame), 5); + gtk_widget_set_size_request (frame, 200, 50); + 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); @@ -267,7 +266,7 @@ void sigh_print_selection( GtkWidget *gtklist, gchar *item_data_string; list_item=GTK_OBJECT(dlist->data); - item_data_string=gtk_object_get_data(list_item, + item_data_string=g_object_get_data(G_OBJECT (list_item), list_item_data_key); g_print("%s ", item_data_string); @@ -275,4 +274,3 @@ void sigh_print_selection( GtkWidget *gtklist, } g_print("\n"); } -/* example-end */ |