diff options
author | Paolo Borelli <pborelli@gnome.org> | 2011-06-26 20:41:21 +0200 |
---|---|---|
committer | Paolo Borelli <pborelli@gnome.org> | 2011-06-26 20:41:21 +0200 |
commit | 399de111167c198a7d2ccbd459a2db7c6389181e (patch) | |
tree | 9d3e62c459794b9dea58bcb09d49159c55b504c2 /gtk/gtknotebook.c | |
parent | 2c916265606f07ac63f18194d045723a373a4bc7 (diff) | |
download | gtk+-399de111167c198a7d2ccbd459a2db7c6389181e.tar.gz |
Speed up page insertion
Make sure to call widget_set_child_visible(false) on all tabs except the
current before calling widget_set_parent.
Diffstat (limited to 'gtk/gtknotebook.c')
-rw-r--r-- | gtk/gtknotebook.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index 7b44f82655..5bf3de5b6b 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -4560,6 +4560,10 @@ gtk_notebook_real_insert_page (GtkNotebook *notebook, gtk_notebook_menu_item_create (notebook, g_list_find (priv->children, page)); + /* child visible will be turned on by switch_page below */ + if (priv->cur_page != page) + gtk_widget_set_child_visible (child, FALSE); + gtk_widget_set_parent (child, GTK_WIDGET (notebook)); if (tab_label) gtk_widget_set_parent (tab_label, GTK_WIDGET (notebook)); @@ -4569,10 +4573,6 @@ gtk_notebook_real_insert_page (GtkNotebook *notebook, if (!priv->first_tab) priv->first_tab = priv->children; - /* child visible will be turned on by switch_page below */ - if (priv->cur_page != page) - gtk_widget_set_child_visible (child, FALSE); - if (tab_label) { if (priv->show_tabs && gtk_widget_get_visible (child)) |