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/selection | |
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/selection')
-rw-r--r-- | examples/selection/Makefile | 10 | ||||
-rw-r--r-- | examples/selection/gettargets.c | 11 | ||||
-rw-r--r-- | examples/selection/setselection.c | 13 |
3 files changed, 19 insertions, 15 deletions
diff --git a/examples/selection/Makefile b/examples/selection/Makefile index fad63ff099..eb07c9635a 100644 --- a/examples/selection/Makefile +++ b/examples/selection/Makefile @@ -1,13 +1,19 @@ CC = gcc +CFLAGS = -Wall \ + -DG_DISABLE_DEPRECATED \ + -DGDK_DISABLE_DEPRECATED \ + -DGDK_PIXBUF_DISABLE_DEPRECATED \ + -DGTK_DISABLE_DEPRECATED + all: gettargets setselection gettargets: gettargets.c - $(CC) `pkg-config --cflags gtk+-2.0` gettargets.c -o gettargets `pkg-config --libs gtk+-2.0` + $(CC) gettargets.c -o gettargets $(CFLAGS) `pkg-config gtk+-2.0 --cflags --libs` setselection: setselection.c - $(CC) `pkg-config --cflags gtk+-2.0` setselection.c -o setselection `pkg-config --libs gtk+-2.0` + $(CC) setselection.c -o setselection $(CFLAGS) `pkg-config gtk+-2.0 --cflags --libs` clean: rm -f *.o gettargets setselection diff --git a/examples/selection/gettargets.c b/examples/selection/gettargets.c index 20292c700b..45d6af4ae8 100644 --- a/examples/selection/gettargets.c +++ b/examples/selection/gettargets.c @@ -1,5 +1,5 @@ -/* example-start selection gettargets.c */ +#include <stdlib.h> #include <gtk/gtk.h> void selection_received( GtkWidget *widget, @@ -74,17 +74,17 @@ int main( int argc, gtk_window_set_title (GTK_WINDOW (window), "Event Box"); gtk_container_set_border_width (GTK_CONTAINER (window), 10); - gtk_signal_connect (GTK_OBJECT (window), "destroy", - GTK_SIGNAL_FUNC (gtk_exit), NULL); + g_signal_connect (GTK_OBJECT (window), "destroy", + GTK_SIGNAL_FUNC (exit), NULL); /* Create a button the user can click to get targets */ button = gtk_button_new_with_label ("Get Targets"); gtk_container_add (GTK_CONTAINER (window), button); - gtk_signal_connect (GTK_OBJECT(button), "clicked", + g_signal_connect (GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC (get_targets), NULL); - gtk_signal_connect (GTK_OBJECT(button), "selection_received", + g_signal_connect (GTK_OBJECT(button), "selection_received", GTK_SIGNAL_FUNC (selection_received), NULL); gtk_widget_show (button); @@ -94,4 +94,3 @@ int main( int argc, return 0; } -/* example-end */ diff --git a/examples/selection/setselection.c b/examples/selection/setselection.c index 690aa49c6c..fe93c44894 100644 --- a/examples/selection/setselection.c +++ b/examples/selection/setselection.c @@ -1,5 +1,5 @@ -/* example-start selection setselection.c */ +#include <stdlib.h> #include <gtk/gtk.h> #include <time.h> @@ -77,8 +77,8 @@ int main( int argc, gtk_window_set_title (GTK_WINDOW (window), "Event Box"); gtk_container_set_border_width (GTK_CONTAINER (window), 10); - gtk_signal_connect (GTK_OBJECT (window), "destroy", - GTK_SIGNAL_FUNC (gtk_exit), NULL); + g_signal_connect (GTK_OBJECT (window), "destroy", + GTK_SIGNAL_FUNC (exit), NULL); /* Create a toggle button to act as the selection */ @@ -86,16 +86,16 @@ int main( int argc, gtk_container_add (GTK_CONTAINER (window), selection_button); gtk_widget_show (selection_button); - gtk_signal_connect (GTK_OBJECT(selection_button), "toggled", + g_signal_connect (GTK_OBJECT(selection_button), "toggled", GTK_SIGNAL_FUNC (selection_toggled), &have_selection); - gtk_signal_connect (GTK_OBJECT(selection_button), "selection_clear_event", + g_signal_connect (GTK_OBJECT(selection_button), "selection_clear_event", GTK_SIGNAL_FUNC (selection_clear), &have_selection); gtk_selection_add_target (selection_button, GDK_SELECTION_PRIMARY, GDK_SELECTION_TYPE_STRING, 1); - gtk_signal_connect (GTK_OBJECT(selection_button), "selection_get", + g_signal_connect (GTK_OBJECT(selection_button), "selection_get", GTK_SIGNAL_FUNC (selection_handle), &have_selection); gtk_widget_show (selection_button); @@ -105,4 +105,3 @@ int main( int argc, return 0; } -/* example-end */ |