diff options
author | Matthias Clasen <mclasen@redhat.com> | 2011-05-26 13:15:40 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2011-05-26 13:15:40 -0400 |
commit | 2c192cf9989f4f962f0d5effa7fd1c9ee69579c2 (patch) | |
tree | 8bf644f34e78536334a342255aeaa748181e799f /examples/buttonbox | |
parent | 76278811b6f9090bda7098b948f6a235ae1b3a2c (diff) | |
download | gtk+-2c192cf9989f4f962f0d5effa7fd1c9ee69579c2.tar.gz |
Cut deadwood
The old tutorial examples haven't been built in years, and are
not useful to keep around in git unless somebody does the work
to integrate them into the 'Getting started' section of the
current docs.
Diffstat (limited to 'examples/buttonbox')
-rw-r--r-- | examples/buttonbox/Makefile | 14 | ||||
-rw-r--r-- | examples/buttonbox/buttonbox.c | 119 |
2 files changed, 0 insertions, 133 deletions
diff --git a/examples/buttonbox/Makefile b/examples/buttonbox/Makefile deleted file mode 100644 index 0863978842..0000000000 --- a/examples/buttonbox/Makefile +++ /dev/null @@ -1,14 +0,0 @@ - -CC = gcc - -CFLAGS = -Wall \ - -DG_DISABLE_DEPRECATED \ - -DGDK_DISABLE_DEPRECATED \ - -DGDK_PIXBUF_DISABLE_DEPRECATED \ - -DGTK_DISABLE_DEPRECATED - -buttonbox: buttonbox.c - $(CC) buttonbox.c -o buttonbox $(CFLAGS) `pkg-config gtk+-2.0 --cflags --libs` - -clean: - rm -f *.o buttonbox diff --git a/examples/buttonbox/buttonbox.c b/examples/buttonbox/buttonbox.c deleted file mode 100644 index 8643974d72..0000000000 --- a/examples/buttonbox/buttonbox.c +++ /dev/null @@ -1,119 +0,0 @@ - -#include <gtk/gtk.h> - -/* Create a Button Box with the specified parameters */ -static GtkWidget *create_bbox( gint horizontal, - char *title, - gint spacing, - gint child_w, - gint child_h, - gint layout ) -{ - GtkWidget *frame; - GtkWidget *bbox; - GtkWidget *button; - - frame = gtk_frame_new (title); - - if (horizontal) - bbox = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL); - else - bbox = gtk_button_box_new (GTK_ORIENTATION_VERTICAL); - - gtk_container_set_border_width (GTK_CONTAINER (bbox), 5); - gtk_container_add (GTK_CONTAINER (frame), bbox); - - /* Set the appearance of the Button Box */ - gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), layout); - gtk_box_set_spacing (GTK_BOX (bbox), spacing); - - button = gtk_button_new_from_stock (GTK_STOCK_OK); - gtk_container_add (GTK_CONTAINER (bbox), button); - - button = gtk_button_new_from_stock (GTK_STOCK_CANCEL); - gtk_container_add (GTK_CONTAINER (bbox), button); - - button = gtk_button_new_from_stock (GTK_STOCK_HELP); - gtk_container_add (GTK_CONTAINER (bbox), button); - - return frame; -} - -int main( int argc, - char *argv[] ) -{ - static GtkWidget* window = NULL; - GtkWidget *main_vbox; - GtkWidget *vbox; - GtkWidget *hbox; - GtkWidget *frame_horz; - GtkWidget *frame_vert; - - /* Initialize GTK */ - gtk_init (&argc, &argv); - - window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_window_set_title (GTK_WINDOW (window), "Button Boxes"); - - g_signal_connect (G_OBJECT (window), "destroy", - G_CALLBACK (gtk_main_quit), - NULL); - - gtk_container_set_border_width (GTK_CONTAINER (window), 10); - - main_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, FALSE, 0); - gtk_container_add (GTK_CONTAINER (window), main_vbox); - - frame_horz = gtk_frame_new ("Horizontal Button Boxes"); - gtk_box_pack_start (GTK_BOX (main_vbox), frame_horz, TRUE, TRUE, 10); - - vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, FALSE, 0); - gtk_container_set_border_width (GTK_CONTAINER (vbox), 10); - gtk_container_add (GTK_CONTAINER (frame_horz), vbox); - - gtk_box_pack_start (GTK_BOX (vbox), - create_bbox (TRUE, "Spread (spacing 40)", 40, 85, 20, GTK_BUTTONBOX_SPREAD), - TRUE, TRUE, 0); - - gtk_box_pack_start (GTK_BOX (vbox), - create_bbox (TRUE, "Edge (spacing 30)", 30, 85, 20, GTK_BUTTONBOX_EDGE), - TRUE, TRUE, 5); - - gtk_box_pack_start (GTK_BOX (vbox), - create_bbox (TRUE, "Start (spacing 20)", 20, 85, 20, GTK_BUTTONBOX_START), - TRUE, TRUE, 5); - - gtk_box_pack_start (GTK_BOX (vbox), - create_bbox (TRUE, "End (spacing 10)", 10, 85, 20, GTK_BUTTONBOX_END), - TRUE, TRUE, 5); - - frame_vert = gtk_frame_new ("Vertical Button Boxes"); - gtk_box_pack_start (GTK_BOX (main_vbox), frame_vert, TRUE, TRUE, 10); - - hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, FALSE, 0); - gtk_container_set_border_width (GTK_CONTAINER (hbox), 10); - gtk_container_add (GTK_CONTAINER (frame_vert), hbox); - - gtk_box_pack_start (GTK_BOX (hbox), - create_bbox (FALSE, "Spread (spacing 5)", 5, 85, 20, GTK_BUTTONBOX_SPREAD), - TRUE, TRUE, 0); - - gtk_box_pack_start (GTK_BOX (hbox), - create_bbox (FALSE, "Edge (spacing 30)", 30, 85, 20, GTK_BUTTONBOX_EDGE), - TRUE, TRUE, 5); - - gtk_box_pack_start (GTK_BOX (hbox), - create_bbox (FALSE, "Start (spacing 20)", 20, 85, 20, GTK_BUTTONBOX_START), - TRUE, TRUE, 5); - - gtk_box_pack_start (GTK_BOX (hbox), - create_bbox (FALSE, "End (spacing 20)", 20, 85, 20, GTK_BUTTONBOX_END), - TRUE, TRUE, 5); - - gtk_widget_show_all (window); - - /* Enter the event loop */ - gtk_main (); - - return 0; -} |