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.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user