GtkBox: Ensure we only allow one center child

Glade was happily adding multiple center widgets. Oops.
This commit is contained in:
Matthias Clasen 2014-10-13 12:44:02 -04:00
parent 0939857e70
commit b4a288a592

View File

@ -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);
}
/**