From 7a322193e85746f69377fc3dff4de8b875f6ed6f Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Thu, 28 Apr 2011 00:51:37 +0200 Subject: [PATCH] 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 file changed, 3 insertions(+) diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index f8f3d1303d..6ab853ac48 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)