diff options
author | Matthias Clasen <mclasen@redhat.com> | 2019-03-27 17:52:51 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2019-03-27 17:53:48 -0400 |
commit | 4a1019bed03ff685b12b776dfefa5b4568dd6947 (patch) | |
tree | 4ed49584d0aa6ec5618841f910c0d64f7d77ae18 /gtk/gtkpopovermenu.c | |
parent | e5722367b3e8f6b0a0f2061a17a31c2878da3f21 (diff) | |
download | gtk+-4a1019bed03ff685b12b776dfefa5b4568dd6947.tar.gz |
popover menu: Add an api for adding submenus
This is a step towards removing the submenu
child property.
Diffstat (limited to 'gtk/gtkpopovermenu.c')
-rw-r--r-- | gtk/gtkpopovermenu.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gtk/gtkpopovermenu.c b/gtk/gtkpopovermenu.c index b5e0d47a2e..2bfa67c944 100644 --- a/gtk/gtkpopovermenu.c +++ b/gtk/gtkpopovermenu.c @@ -384,3 +384,23 @@ gtk_popover_menu_open_submenu (GtkPopoverMenu *popover, stack = gtk_bin_get_child (GTK_BIN (popover)); gtk_stack_set_visible_child_name (GTK_STACK (stack), name); } + +/** + * gtk_popover_menu_add_submenu: + * @popover: a #GtkPopoverMenu + * @submenu: a widget to add as submenu + * @name: the name for the submenu + * + * Adds a submenu to the popover menu. + */ +void +gtk_popover_menu_add_submenu (GtkPopoverMenu *popover, + GtkWidget *submenu, + const char *name) +{ + GtkWidget *stack; + + stack = gtk_bin_get_child (GTK_BIN (object)); + + gtk_stack_add_named (GTK_STACK (stack), submenu, name); +} |