summaryrefslogtreecommitdiff
path: root/gtk/gtkstackswitcher.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2014-10-06 23:06:09 -0400
committerMatthias Clasen <mclasen@redhat.com>2014-10-06 23:06:09 -0400
commitc53f4bb3421f7b3ec06bf12c1fcdd95f75321aab (patch)
tree3ed3cd4d297895bcea66c35f66ff2a0d880fa9d2 /gtk/gtkstackswitcher.c
parentba63f95a4a8e87b3bccee8c4d6ae88b8d890c2e3 (diff)
downloadgtk+-c53f4bb3421f7b3ec06bf12c1fcdd95f75321aab.tar.gz
GtkStackSwitcher: Pick up the visible child from the stack
We forgot to synchronize the visible child when setting a stack on the switcher. Oops.
Diffstat (limited to 'gtk/gtkstackswitcher.c')
-rw-r--r--gtk/gtkstackswitcher.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gtk/gtkstackswitcher.c b/gtk/gtkstackswitcher.c
index 9a114bcb43..42e683f5e2 100644
--- a/gtk/gtkstackswitcher.c
+++ b/gtk/gtkstackswitcher.c
@@ -292,9 +292,17 @@ static void
populate_switcher (GtkStackSwitcher *self)
{
GtkStackSwitcherPrivate *priv;
+ GtkWidget *widget, *button;
priv = gtk_stack_switcher_get_instance_private (self);
gtk_container_foreach (GTK_CONTAINER (priv->stack), (GtkCallback)add_child, self);
+
+ widget = gtk_stack_get_visible_child (priv->stack);
+ if (widget)
+ {
+ button = g_hash_table_lookup (priv->buttons, widget);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
+ }
}
static void