[gtk+] notebook: Warn if builder file defines multiple tab widgets per page



commit 7a322193e85746f69377fc3dff4de8b875f6ed6f
Author: Benjamin Otte <otte redhat com>
Date:   Thu Apr 28 00:51:37 2011 +0200

    notebook: Warn if builder file defines multiple tab widgets per page
    
    Glade causes such files when a notebook page has no content. And it's
    especially bad because the last tab widget wins, so the label displayed
    in Glade will not be what you see when you run the app.

 gtk/gtknotebook.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index f8f3d13..6ab853a 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -1228,6 +1228,9 @@ gtk_notebook_buildable_add_child (GtkBuildable  *buildable,
       /* To set the tab label widget, we must have already a child
        * inside the tab container. */
       g_assert (page != NULL);
+      /* warn when Glade tries to overwrite label */
+      if (gtk_notebook_get_tab_label (notebook, page))
+        g_warning ("Overriding tab label for notebook");
       gtk_notebook_set_tab_label (notebook, page, GTK_WIDGET (child));
     }
   else if (type && strcmp (type, "action-start") == 0)



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