From d1bda8d56232ff0431796add4029e129f877fd6a Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Wed, 10 Feb 1999 02:35:09 +0000 Subject: Fixed some bugs with set_default_size. Sun Feb 7 19:49:21 1999 Owen Taylor * gtk/gtkwindow.c (gtk_window_move_resize): Fixed some bugs with set_default_size. Sat Feb 6 13:23:51 1999 Owen Taylor * docs/Changes-1.2.txt: Added information about the change to gtk_widget_size_request(). * gtk/gtkentry.c: Call gtk_widget_get_child_requisition explicitely since we differentiate between the usize set by the user and what we got. (Ugh) * gtk/gtkwidget.[ch] (gtk_widget_get_child_requisition): New function to return the effective size of a widget as it looks to its parent. * gtk/gtkwidget.c (gtk_widget_size_request): Leave widget->requisition set to exactly what the widget asked for, and then make a copy of that into the requisition argument. Allow a NULL requisition argument, and, if G_ENABLE_DEBUG, warn if requisition == &widget->requisition. * gtkalignment.c gtkaspectframe.c gtkbutton.c gtkclist.c gtkcontainer.c gtkentry.c gtkeventbox.c gtkfixed.c gtkframe.c gtkhandlebox.c gtkhbox.c gtkhpaned.c gtklayout.c gtklist.c gtklistitem.c gtkmenu.c gtkmenubar.c gtkmenuitem.c gtknotebook.c gtkoptionmenu.c gtkpacker.c gtkscrolledwindow.c gtktable.c gtktoolbar.c gtktree.c gtktreeitem.c gtkvbox.c gtkviewport.c gtkvpaned.c gtkwindow.c Avoid calling gtk_widget_size_request with requisition == widget->requisition; use gtk_widget_get_child_requisition to get the size of children. --- gtk/gtkeventbox.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'gtk/gtkeventbox.c') diff --git a/gtk/gtkeventbox.c b/gtk/gtkeventbox.c index 3880a050a9..ddf0f1d15f 100644 --- a/gtk/gtkeventbox.c +++ b/gtk/gtkeventbox.c @@ -142,10 +142,12 @@ gtk_event_box_size_request (GtkWidget *widget, if (bin->child && GTK_WIDGET_VISIBLE (bin->child)) { - gtk_widget_size_request (bin->child, &bin->child->requisition); + GtkRequisition child_requisition; + + gtk_widget_size_request (bin->child, &child_requisition); - requisition->width += bin->child->requisition.width; - requisition->height += bin->child->requisition.height; + requisition->width += child_requisition.width; + requisition->height += child_requisition.height; } } -- cgit v1.2.1