[gtk/nbpage: 10/21] Allow builder to add notebook pages



commit 7f8ba95db55d046326e4816d469cf859882d3f79
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Feb 20 11:43:15 2019 -0500

    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)
         {


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