diff options
author | Matthias Clasen <mclasen@redhat.com> | 2014-10-13 12:44:02 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2014-10-13 12:45:05 -0400 |
commit | b4a288a5927bf4fc1f1647399d218a577b0ecd09 (patch) | |
tree | 208a8e5ba7ddf27cdf91795ec4822f5e00413573 /gtk/gtkbox.c | |
parent | 0939857e70fa2c72f1e6599cd274c197596487fa (diff) | |
download | gtk+-b4a288a5927bf4fc1f1647399d218a577b0ecd09.tar.gz |
GtkBox: Ensure we only allow one center child
Glade was happily adding multiple center widgets. Oops.
Diffstat (limited to 'gtk/gtkbox.c')
-rw-r--r-- | gtk/gtkbox.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gtk/gtkbox.c b/gtk/gtkbox.c index 613b5aeae7..72f26e94cd 100644 --- a/gtk/gtkbox.c +++ b/gtk/gtkbox.c @@ -2619,10 +2619,14 @@ gtk_box_set_center_widget (GtkBox *box, g_return_if_fail (GTK_IS_BOX (box)); + if (priv->center) + { + gtk_box_remove (GTK_CONTAINER (box), priv->center->widget); + priv->center = NULL; + } + if (widget) priv->center = gtk_box_pack (box, widget, FALSE, TRUE, 0, GTK_PACK_START); - else if (priv->center) - gtk_box_remove (GTK_CONTAINER (box), priv->center->widget); } /** |