[gtk/ebassi/childless-stack-page: 1218/1219] GtkStack: Create stack pages with child




commit 2e7c1649ef107bdce18f4773374bdd170fb28402
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri May 27 17:24:14 2022 -0400

    GtkStack: Create stack pages with child
    
    We're requiring stack pages to have a child
    at construction time now. Make it so!

 gtk/gtkstack.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)
---
diff --git a/gtk/gtkstack.c b/gtk/gtkstack.c
index 6f75f9e860..85554d563c 100644
--- a/gtk/gtkstack.c
+++ b/gtk/gtkstack.c
@@ -1506,13 +1506,11 @@ gtk_stack_add_internal (GtkStack   *stack,
 
   g_return_val_if_fail (child != NULL, NULL);
 
-  child_info = g_object_new (GTK_TYPE_STACK_PAGE, NULL);
-  child_info->widget = g_object_ref (child);
-  child_info->name = g_strdup (name);
-  child_info->title = g_strdup (title);
-  child_info->icon_name = NULL;
-  child_info->needs_attention = FALSE;
-  child_info->last_focus = NULL;
+  child_info = g_object_new (GTK_TYPE_STACK_PAGE,
+                             "child", child,
+                             "name", name,
+                             "title", title,
+                             NULL);
 
   gtk_stack_add_page (stack, child_info);
 


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