diff options
author | Elliot Lee <sopwith@src.gnome.org> | 1997-12-19 19:17:45 +0000 |
---|---|---|
committer | Elliot Lee <sopwith@src.gnome.org> | 1997-12-19 19:17:45 +0000 |
commit | 61124945c03460d8f0fc891c65f0c41dc1436e78 (patch) | |
tree | 0759761593157c274af81398f8e4409f1c29a476 /gtk/testgtk.c | |
parent | e9f322e2f020e977c1fe6b0fb93807d978da16a2 (diff) | |
download | gtk+-61124945c03460d8f0fc891c65f0c41dc1436e78.tar.gz |
more gtkhandlebox work..
Diffstat (limited to 'gtk/testgtk.c')
-rw-r--r-- | gtk/testgtk.c | 47 |
1 files changed, 46 insertions, 1 deletions
diff --git a/gtk/testgtk.c b/gtk/testgtk.c index a1d5545dfe..dfb7958c34 100644 --- a/gtk/testgtk.c +++ b/gtk/testgtk.c @@ -20,7 +20,7 @@ #include "gtk.h" #include "../gdk/gdk.h" #include "../gdk/gdkx.h" - +#include "gtkhandlebox.h" void destroy_window (GtkWidget *widget, @@ -548,6 +548,50 @@ create_button_box () gtk_widget_destroy (window); } +void +create_handle_box () +{ + static GtkWidget* window = NULL; + GtkWidget* hbox; + GtkWidget* button; + + if (!window) + { + window = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_window_set_title (GTK_WINDOW (window), + "Handle Box Test"); + + gtk_signal_connect (GTK_OBJECT (window), "destroy", + GTK_SIGNAL_FUNC(destroy_window), &window); + gtk_signal_connect (GTK_OBJECT (window), "delete_event", + GTK_SIGNAL_FUNC(destroy_window), &window); + + gtk_container_border_width (GTK_CONTAINER (window), 20); + + /* + *these 15 lines are a nice and easy example for GtkHButtonBox + */ + hbox = gtk_handle_box_new (); + gtk_container_add (GTK_CONTAINER (window), hbox); + gtk_widget_set_usize(hbox, 300, 40); + gtk_widget_show (hbox); + +#if 0 + button = gtk_toggle_button_new_with_label ("Let's try this"); +#else + button = gtk_label_new ("Let's try this"); +#endif + gtk_container_add (GTK_CONTAINER (hbox), button); + gtk_widget_set_usize(button, 250, 40); + gtk_widget_show (button); + } + + if (!GTK_WIDGET_VISIBLE (window)) + gtk_widget_show (window); + else + gtk_widget_destroy (window); +} + void reparent_label (GtkWidget *widget, @@ -3234,6 +3278,7 @@ create_main_window () { "check buttons", create_check_buttons }, { "radio buttons", create_radio_buttons }, { "button box", create_button_box }, + { "handle box", create_handle_box }, { "reparent", create_reparent }, { "pixmap", create_pixmap }, { "tooltips", create_tooltips }, |