summaryrefslogtreecommitdiff
path: root/examples/statusbar
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/statusbar
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/statusbar')
-rw-r--r--examples/statusbar/Makefile8
-rw-r--r--examples/statusbar/statusbar.c22
2 files changed, 14 insertions, 16 deletions
diff --git a/examples/statusbar/Makefile b/examples/statusbar/Makefile
index 6ca8eaf1a..e2bf326ba 100644
--- a/examples/statusbar/Makefile
+++ b/examples/statusbar/Makefile
@@ -1,8 +1,14 @@
CC = gcc
+CFLAGS = -Wall \
+ -DG_DISABLE_DEPRECATED \
+ -DGDK_DISABLE_DEPRECATED \
+ -DGDK_PIXBUF_DISABLE_DEPRECATED \
+ -DGTK_DISABLE_DEPRECATED
+
statusbar: statusbar.c
- $(CC) `pkg-config --cflags gtk+-2.0` statusbar.c -o statusbar `pkg-config --libs gtk+-2.0`
+ $(CC) statusbar.c -o statusbar $(CFLAGS) `pkg-config gtk+-2.0 --cflags --libs`
clean:
rm -f *.o statusbar
diff --git a/examples/statusbar/statusbar.c b/examples/statusbar/statusbar.c
index c738bf02c..55e1bda9b 100644
--- a/examples/statusbar/statusbar.c
+++ b/examples/statusbar/statusbar.c
@@ -1,5 +1,5 @@
-/* example-start statusbar statusbar.c */
+#include <stdlib.h>
#include <gtk/gtk.h>
#include <glib.h>
@@ -38,10 +38,10 @@ int main( int argc,
/* create a new window */
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
- gtk_widget_set_usize( GTK_WIDGET (window), 200, 100);
+ gtk_widget_set_size_request (GTK_WIDGET (window), 200, 100);
gtk_window_set_title(GTK_WINDOW (window), "GTK Statusbar Example");
- gtk_signal_connect(GTK_OBJECT (window), "delete_event",
- (GtkSignalFunc) gtk_exit, NULL);
+ g_signal_connect(GTK_OBJECT (window), "delete_event",
+ GTK_SIGNAL_FUNC (exit), NULL);
vbox = gtk_vbox_new(FALSE, 1);
gtk_container_add(GTK_CONTAINER(window), vbox);
@@ -55,23 +55,15 @@ int main( int argc,
GTK_STATUSBAR(status_bar), "Statusbar example");
button = gtk_button_new_with_label("push item");
- gtk_signal_connect(GTK_OBJECT(button), "clicked",
+ g_signal_connect(GTK_OBJECT(button), "clicked",
GTK_SIGNAL_FUNC (push_item), GINT_TO_POINTER(context_id) );
gtk_box_pack_start(GTK_BOX(vbox), button, TRUE, TRUE, 2);
gtk_widget_show(button);
button = gtk_button_new_with_label("pop last item");
- gtk_signal_connect(GTK_OBJECT(button), "clicked",
+ g_signal_connect(GTK_OBJECT(button), "clicked",
GTK_SIGNAL_FUNC (pop_item), GINT_TO_POINTER(context_id) );
gtk_box_pack_start(GTK_BOX(vbox), button, TRUE, TRUE, 2);
- gtk_widget_show(button);
+ gtk_widget_show(button);
/* always display the window as the last step so it all splashes on
- * the screen at once. */
- gtk_widget_show(window);
-
- gtk_main ();
-
- return 0;
-}
-/* example-end */