mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-28 22:41:43 +00:00
GtkBox: Fix self-assignment for center widget
This is happening when glade is loading ui files containing center widgets.
This commit is contained in:
parent
1376c6b1b7
commit
8b6457732f
@ -2616,17 +2616,22 @@ gtk_box_set_center_widget (GtkBox *box,
|
||||
GtkWidget *widget)
|
||||
{
|
||||
GtkBoxPrivate *priv = box->priv;
|
||||
GtkWidget *old_center = NULL;
|
||||
|
||||
g_return_if_fail (GTK_IS_BOX (box));
|
||||
|
||||
if (priv->center)
|
||||
{
|
||||
old_center = g_object_ref (priv->center->widget);
|
||||
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);
|
||||
|
||||
if (old_center)
|
||||
g_object_unref (old_center);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user