summaryrefslogtreecommitdiff
path: root/examples/helloworld2
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/helloworld2
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/helloworld2')
-rw-r--r--examples/helloworld2/Makefile8
-rw-r--r--examples/helloworld2/helloworld2.c14
2 files changed, 13 insertions, 9 deletions
diff --git a/examples/helloworld2/Makefile b/examples/helloworld2/Makefile
index d1433bcb9..d574f2e4b 100644
--- a/examples/helloworld2/Makefile
+++ b/examples/helloworld2/Makefile
@@ -1,8 +1,14 @@
CC = gcc
+CFLAGS = -Wall \
+ -DG_DISABLE_DEPRECATED \
+ -DGDK_DISABLE_DEPRECATED \
+ -DGDK_PIXBUF_DISABLE_DEPRECATED \
+ -DGTK_DISABLE_DEPRECATED
+
helloworld2: helloworld2.c
- $(CC) `pkg-config --cflags gtk+-2.0` helloworld2.c -o helloworld2 `pkg-config --libs gtk+-2.0`
+ $(CC) helloworld2.c -o helloworld2 $(CFLAGS) `pkg-config gtk+-2.0 --cflags --libs`
clean:
rm -f *.o helloworld2
diff --git a/examples/helloworld2/helloworld2.c b/examples/helloworld2/helloworld2.c
index ae41fd15f..79bbd039d 100644
--- a/examples/helloworld2/helloworld2.c
+++ b/examples/helloworld2/helloworld2.c
@@ -1,4 +1,3 @@
-/* example-start helloworld2 helloworld2.c */
#include <gtk/gtk.h>
@@ -40,7 +39,7 @@ int main( int argc,
/* Here we just set a handler for delete_event that immediately
* exits GTK. */
- gtk_signal_connect (GTK_OBJECT (window), "delete_event",
+ g_signal_connect (GTK_OBJECT (window), "delete_event",
GTK_SIGNAL_FUNC (delete_event), NULL);
/* Sets the border width of the window. */
@@ -56,10 +55,10 @@ int main( int argc,
/* Creates a new button with the label "Button 1". */
button = gtk_button_new_with_label ("Button 1");
-
+
/* Now when the button is clicked, we call the "callback" function
* with a pointer to "button 1" as its argument */
- gtk_signal_connect (GTK_OBJECT (button), "clicked",
+ g_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (callback), (gpointer) "button 1");
/* Instead of gtk_container_add, we pack this button into the invisible
@@ -75,7 +74,7 @@ int main( int argc,
/* Call the same callback function with a different argument,
* passing a pointer to "button 2" instead. */
- gtk_signal_connect (GTK_OBJECT (button), "clicked",
+ g_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (callback), (gpointer) "button 2");
gtk_box_pack_start(GTK_BOX(box1), button, TRUE, TRUE, 0);
@@ -87,10 +86,9 @@ int main( int argc,
gtk_widget_show(box1);
gtk_widget_show (window);
-
+
/* Rest in gtk_main and wait for the fun to begin! */
gtk_main ();
- return(0);
+ return 0;
}
-/* example-end */