diff options
author | Tim Janik <timj@gtk.org> | 1998-06-24 06:25:14 +0000 |
---|---|---|
committer | Tim Janik <timj@src.gnome.org> | 1998-06-24 06:25:14 +0000 |
commit | dbce6083ef090a3971be3397f899d770b368c5e2 (patch) | |
tree | 1e2999ef5f7257a49d6df0acbe4e8dd06c7d3a5a /tests | |
parent | 00362c03f732591722343789fb22d9f6e371eafb (diff) | |
download | gtk+-dbce6083ef090a3971be3397f899d770b368c5e2.tar.gz |
added a frame with radio buttons to select the resize_mode for the
Wed Jun 24 07:47:29 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c (create_idle_test): added a frame with radio buttons
to select the resize_mode for the idle-labels container.
* gtk/gtkframe.h:
* gtk/gtkframe.c: GtkType and macro corrections.
* gtk/gtkradiobutton.c (gtk_radio_button_set_arg): new function to
support radio grouping.
Tue Jun 23 08:01:09 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c (gtk_container_set_resize_mode): queue a resize
unconditionally if resize_mode has changed.
* gtk/gtkscrolledwindow.c (gtk_scrolled_window_init): set
GTK_RESIZE_QUEUE on the scrolled window.
(gtk_scrolled_window_construct): set GTK_RESIZE_PARENT for the vieport.
Tue Jun 23 04:20:30 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c:
(GTK_IS_RESIZE_CONTAINER): new macro to find out if
a given gtkobject is a container with resize_mode==GTK_RESIZE_PARENT.
(gtk_container_queue_resize): new function to queue a container for
a *size* reallocation (doesn't affect its position, and thus its
parent is left untouched usually).
(gtk_container_get_resize_container): new function to retrive the next
most resize container which is not itself queued for a resize.
(gtk_container_idle_sizer): new function to carefully process the
container_resize_queue since it can change during invokation of
gtk_container_check_resize().
(gtk_container_resize_children): total rework of this function to
properly handle resize containers. makes a lot of assumptions whitch
are stated in the comments.
* gtk/gtkcontainer.c:
(gtk_container_real_check_resize): only requeue ourselves if we are not
a resize container.
(gtk_container_clear_resize_widgets): care for automatic deletion of our
resize_widgets list on size_allocate through a handler connection.
* gtk/gtkwindow.c (gtk_window_shutdown): new functionm to reset the
focus and default widget of a window, so to take the burden from
gtk_widget_unparent.
* gtk/gtkviewport.c: removed gtk_viewport_check_resize, which tried
to be clever, but actually messed up the resize_children logic and
caused unneccessary allocations on its whole branch. besides this,
it messed up the display by not invoking a redraw after the allocation.
* gtk/gtktable.c (gtk_table_set_child_arg): reverted recent change, so
that it is the child again that is queued for a resize.
(gtk_table_attach): likewise.
(gtk_table_remove): likewise.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/testgtk.c | 75 |
1 files changed, 68 insertions, 7 deletions
diff --git a/tests/testgtk.c b/tests/testgtk.c index cbbc35a9e5..8e01df8f0f 100644 --- a/tests/testgtk.c +++ b/tests/testgtk.c @@ -6536,7 +6536,7 @@ create_timeout_test (void) */ static int idle = 0; -gint +static gint idle_test (GtkWidget *label) { static int count = 0; @@ -6548,7 +6548,7 @@ idle_test (GtkWidget *label) return TRUE; } -void +static void start_idle_test (GtkWidget *widget, GtkWidget *label) { @@ -6558,7 +6558,7 @@ start_idle_test (GtkWidget *widget, } } -void +static void stop_idle_test (GtkWidget *widget, gpointer data) { @@ -6569,7 +6569,7 @@ stop_idle_test (GtkWidget *widget, } } -void +static void destroy_idle_test (GtkWidget *widget, GtkWidget **window) { @@ -6578,15 +6578,26 @@ destroy_idle_test (GtkWidget *widget, *window = NULL; } -void +static void +toggle_idle_container (GtkObject *button, + GtkContainer *container) +{ + gtk_container_set_resize_mode (container, (guint) gtk_object_get_user_data (button)); +} + +static void create_idle_test (void) { static GtkWidget *window = NULL; GtkWidget *button; GtkWidget *label; + GtkWidget *container; if (!window) { + GtkWidget *frame; + GtkWidget *box; + window = gtk_dialog_new (); gtk_signal_connect (GTK_OBJECT (window), "destroy", @@ -6598,9 +6609,59 @@ create_idle_test (void) label = gtk_label_new ("count: 0"); gtk_misc_set_padding (GTK_MISC (label), 10, 10); - gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), - label, TRUE, TRUE, 0); gtk_widget_show (label); + + container = + gtk_widget_new (GTK_TYPE_HBOX, + "GtkWidget::visible", TRUE, + /* "GtkContainer::child", gtk_widget_new (GTK_TYPE_HBOX, + * "GtkWidget::visible", TRUE, + */ + "GtkContainer::child", label, + /* NULL), */ + NULL); + gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), + container, TRUE, TRUE, 0); + + frame = + gtk_widget_new (GTK_TYPE_FRAME, + "GtkContainer::border_width", 5, + "GtkFrame::label", "Label Container", + "GtkWidget::visible", TRUE, + "GtkWidget::parent", GTK_DIALOG (window)->vbox, + NULL); + box = + gtk_widget_new (GTK_TYPE_VBOX, + "GtkWidget::visible", TRUE, + "GtkWidget::parent", frame, + NULL); + button = + gtk_widget_new (GTK_TYPE_RADIO_BUTTON, + "GtkButton::label", "Resize-Parent", + "GtkObject::user_data", (void*)GTK_RESIZE_PARENT, + "GtkObject::signal::clicked", toggle_idle_container, container, + "GtkWidget::visible", TRUE, + "GtkWidget::parent", box, + NULL); + button = + gtk_widget_new (GTK_TYPE_RADIO_BUTTON, + "GtkButton::label", "Resize-Queue", + "GtkObject::user_data", (void*)GTK_RESIZE_QUEUE, + "GtkObject::signal::clicked", toggle_idle_container, container, + "GtkRadioButton::group", button, + "GtkWidget::visible", TRUE, + "GtkWidget::parent", box, + NULL); + button = + gtk_widget_new (GTK_TYPE_RADIO_BUTTON, + "GtkButton::label", "Resize-Immediate", + "GtkObject::user_data", (void*)GTK_RESIZE_IMMEDIATE, + "GtkObject::signal::clicked", toggle_idle_container, container, + "GtkRadioButton::group", button, + "GtkWidget::visible", TRUE, + "GtkWidget::parent", box, + NULL); + button = gtk_button_new_with_label ("close"); gtk_signal_connect_object (GTK_OBJECT (button), "clicked", |