From 7f8ba95db55d046326e4816d469cf859882d3f79 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 20 Feb 2019 11:43:15 -0500 Subject: [PATCH] Allow builder to add notebook pages --- gtk/gtknotebook.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index fabbfe7ee5..1566aacfb3 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -716,6 +716,9 @@ static GList * gtk_notebook_search_page (GtkNotebook *notebook, gboolean find_visible); static void gtk_notebook_child_reordered (GtkNotebook *notebook, GtkNotebookPage *page); +static gint gtk_notebook_insert_notebook_page (GtkNotebook *notebook, + GtkNotebookPage *page, + int position); /*** GtkNotebook Size Allocate Functions ***/ static void gtk_notebook_pages_allocate (GtkNotebook *notebook, @@ -1376,7 +1379,11 @@ gtk_notebook_buildable_add_child (GtkBuildable *buildable, { GtkNotebook *notebook = GTK_NOTEBOOK (buildable); - if (GTK_IS_WIDGET (child)) + if (GTK_IS_NOTEBOOK_PAGE (child)) + { + gtk_notebook_insert_notebook_page (notebook, GTK_NOTEBOOK_PAGE (child), -1); + } + else if (GTK_IS_WIDGET (child)) { if (type && strcmp (type, "tab") == 0) {