[gtk+] notebook: Set the current page when none is set



commit 1190efebce5892f80545a91461c6b9c80abfd7e7
Author: Benjamin Otte <otte redhat com>
Date:   Sat Dec 19 06:56:04 2015 +0100

    notebook: Set the current page when none is set
    
    This case happens when you gtk_widget_show_all (notebook).

 gtk/gtknotebook.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index ce05f75..f43b7da 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -4771,6 +4771,13 @@ page_visible_cb (GtkWidget  *child,
       if (next)
         gtk_notebook_switch_page (notebook, GTK_NOTEBOOK_PAGE (next));
     }
+  
+  if (!priv->cur_page && gtk_widget_get_visible (child))
+    {
+      gtk_notebook_switch_page (notebook, page);
+      /* focus_tab is set in the switch_page method */
+      gtk_notebook_switch_focus_tab (notebook, priv->focus_tab);
+    }
 }
 
 static gint


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]