diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-09-15 18:37:56 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-09-15 18:39:09 -0400 |
commit | cc9fe4b354a6ae14f7f85d62d7807955d7a54799 (patch) | |
tree | 89f726cdfd85f4bc1ea722b16e58972fe963009b /gtk/gtkstack.c | |
parent | e4d29ba9fdfb78625dd792d9956783352b6b6208 (diff) | |
download | gtk+-stack-add-child.tar.gz |
stack: Add gtk_stack_add_childstack-add-child
The name of children is not essential, so add
a way to add children without providing one.
Fixes: #3165
Diffstat (limited to 'gtk/gtkstack.c')
-rw-r--r-- | gtk/gtkstack.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gtk/gtkstack.c b/gtk/gtkstack.c index 75a2fa9e30..8fd95a39f1 100644 --- a/gtk/gtkstack.c +++ b/gtk/gtkstack.c @@ -1293,6 +1293,25 @@ gtk_stack_add_titled (GtkStack *stack, } /** + * gtk_stack_add_child: + * @stack: a #GtkStack + * @child: the widget to add + * + * Adds a child to @stack. + * + * Returns: (transfer none): the #GtkStackPage for @child + */ +GtkStackPage * +gtk_stack_add_child (GtkStack *stack, + GtkWidget *child) +{ + g_return_val_if_fail (GTK_IS_STACK (stack), NULL); + g_return_val_if_fail (GTK_IS_WIDGET (child), NULL); + + return gtk_stack_add_internal (stack, child, NULL, NULL); +} + +/** * gtk_stack_add_named: * @stack: a #GtkStack * @child: the widget to add |