[tepl] Notebook: print warning in set_active_tab() if child widget invisible



commit f4cd9706f7e31be648ec07719782984697a123c3
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Sun Jul 23 06:58:52 2017 +0200

    Notebook: print warning in set_active_tab() if child widget invisible

 tepl/tepl-notebook.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/tepl/tepl-notebook.c b/tepl/tepl-notebook.c
index dfb9ae9..37b4a0d 100644
--- a/tepl/tepl-notebook.c
+++ b/tepl/tepl-notebook.c
@@ -234,6 +234,13 @@ tepl_notebook_set_active_tab (TeplTabGroup *tab_group,
        page_num = gtk_notebook_page_num (notebook, GTK_WIDGET (tab));
        g_return_if_fail (page_num != -1);
 
+       if (!gtk_widget_get_visible (GTK_WIDGET (tab)))
+       {
+               g_warning ("Calling gtk_notebook_set_current_page() on an "
+                          "invisible TeplTab. This won't work, make the "
+                          "TeplTab visible first.");
+       }
+
        gtk_notebook_set_current_page (notebook, page_num);
 }
 


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