summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorElliot Lee <sopwith@src.gnome.org>1998-04-07 19:51:06 +0000
committerElliot Lee <sopwith@src.gnome.org>1998-04-07 19:51:06 +0000
commit39a05c0b55f444eea0a943378c54546f8feea52a (patch)
tree00c292d456c6dea043043d4c4458dfd1f93ca307 /gtk
parent8051b9d2bc7975cfc86705f4994e37495da56f20 (diff)
downloadgtk+-39a05c0b55f444eea0a943378c54546f8feea52a.tar.gz
gtk_button_remove(): When removing a child widget from a button, we don't
gtk_button_remove(): When removing a child widget from a button, we don't want to check the child's visibility after removal (for the purpose of knowing whether a queue_resize is needed), we want to check it *before*, because the child may be destroyed during the gtk_widget_unparent() The diff is clearer than this stupid log message. :)
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtkbutton.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c
index 884a5a8244..17b9a56d73 100644
--- a/gtk/gtkbutton.c
+++ b/gtk/gtkbutton.c
@@ -816,12 +816,15 @@ gtk_button_remove (GtkContainer *container,
if (button->child == widget)
{
+ gboolean widget_was_visible = GTK_WIDGET_VISIBLE(widget);
+
gtk_widget_unparent (widget);
button->child = NULL;
- if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_VISIBLE (container))
+ if (widget_was_visible && GTK_WIDGET_VISIBLE (container))
gtk_widget_queue_resize (GTK_WIDGET (container));
+
}
}