summaryrefslogtreecommitdiff
path: root/examples/scrolledwin
diff options
context:
space:
mode:
authorMatthias Clasen <matthiasc@src.gnome.org>2002-02-16 23:52:30 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2002-02-16 23:52:30 +0000
commitb3d5f148e6c0e2cb688403655c7800b762e33602 (patch)
tree1056439dd24e464adbabc5c374182a886c669345 /examples/scrolledwin
parent554838e4f602d59f5be241d1da188934d51d49c3 (diff)
downloadgdk-pixbuf-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/scrolledwin')
-rw-r--r--examples/scrolledwin/Makefile8
-rw-r--r--examples/scrolledwin/scrolledwin.c11
2 files changed, 12 insertions, 7 deletions
diff --git a/examples/scrolledwin/Makefile b/examples/scrolledwin/Makefile
index ae74e8283..2f07fd50e 100644
--- a/examples/scrolledwin/Makefile
+++ b/examples/scrolledwin/Makefile
@@ -1,8 +1,14 @@
CC = gcc
+CFLAGS = -Wall \
+ -DG_DISABLE_DEPRECATED \
+ -DGDK_DISABLE_DEPRECATED \
+ -DGDK_PIXBUF_DISABLE_DEPRECATED \
+ -DGTK_DISABLE_DEPRECATED
+
scrolledwin: scrolledwin.c
- $(CC) `pkg-config --cflags gtk+-2.0` scrolledwin.c -o scrolledwin `pkg-config --libs gtk+-2.0`
+ $(CC) scrolledwin.c -o scrolledwin $(CFLAGS) `pkg-config gtk+-2.0 --cflags --libs`
clean:
rm -f *.o scrolledwin
diff --git a/examples/scrolledwin/scrolledwin.c b/examples/scrolledwin/scrolledwin.c
index 977dcf20f..3c9caef70 100644
--- a/examples/scrolledwin/scrolledwin.c
+++ b/examples/scrolledwin/scrolledwin.c
@@ -1,5 +1,5 @@
-/* example-start scrolledwin scrolledwin.c */
+#include <stdio.h>
#include <gtk/gtk.h>
void destroy( GtkWidget *widget,
@@ -23,11 +23,11 @@ int main( int argc,
/* Create a new dialog window for the scrolled window to be
* packed into. */
window = gtk_dialog_new ();
- gtk_signal_connect (GTK_OBJECT (window), "destroy",
+ g_signal_connect (GTK_OBJECT (window), "destroy",
(GtkSignalFunc) destroy, NULL);
gtk_window_set_title (GTK_WINDOW (window), "GtkScrolledWindow example");
gtk_container_set_border_width (GTK_CONTAINER (window), 0);
- gtk_widget_set_usize(window, 300, 300);
+ gtk_widget_set_size_request (window, 300, 300);
/* create a new scrolled window. */
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
@@ -71,7 +71,7 @@ int main( int argc,
/* Add a "close" button to the bottom of the dialog */
button = gtk_button_new_with_label ("close");
- gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
+ g_signal_connect_swapped (GTK_OBJECT (button), "clicked",
(GtkSignalFunc) gtk_widget_destroy,
GTK_OBJECT (window));
@@ -89,6 +89,5 @@ int main( int argc,
gtk_main();
- return(0);
+ return 0;
}
-/* example-end */