[gtk+/gtk-3-14] GtkBox: Ensure we only allow one center child
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-14] GtkBox: Ensure we only allow one center child
- Date: Mon, 13 Oct 2014 16:44:37 +0000 (UTC)
commit 1670ba1d511a6e7e90ca7002ed6bbe80db7f1895
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Oct 13 12:44:02 2014 -0400
GtkBox: Ensure we only allow one center child
Glade was happily adding multiple center widgets. Oops.
gtk/gtkbox.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkbox.c b/gtk/gtkbox.c
index 613b5ae..72f26e9 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);
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]