GtkPopoverMenu is a subclass of #GtkPopover that treats its
children like menus and allows switching between them. It is
meant to be used primarily together with #GtkModelButton, but
any widget can be used, such as #GtkSpinButton or #GtkScale.
In this respect, GtkPopoverMenu is more flexible than popovers
that are created from a #GMenuModel with gtk.popover.Popover.newFromModel.
To add a child as a submenu, set the #GtkPopoverMenu:submenu
child property to the name of the submenu. To let the user open
this submenu, add a #GtkModelButton whose #GtkModelButton:menu-name
property is set to the name you've given to the submenu.
By convention, the first child of a submenu should be a #GtkModelButton
to switch back to the parent menu. Such a button should use the
#GtkModelButton:inverted and #GtkModelButton:centered properties
to achieve a title-like appearance and place the submenu indicator
at the opposite side. To switch back to the main menu, use "main"
as the menu name.
Just like normal popovers created using gtk_popover_new_from_model,
#GtkPopoverMenu instances have a single css node called "popover"
and get the .menu style class.
GtkPopoverMenu is a subclass of #GtkPopover that treats its children like menus and allows switching between them. It is meant to be used primarily together with #GtkModelButton, but any widget can be used, such as #GtkSpinButton or #GtkScale. In this respect, GtkPopoverMenu is more flexible than popovers that are created from a #GMenuModel with gtk.popover.Popover.newFromModel.
To add a child as a submenu, set the #GtkPopoverMenu:submenu child property to the name of the submenu. To let the user open this submenu, add a #GtkModelButton whose #GtkModelButton:menu-name property is set to the name you've given to the submenu.
By convention, the first child of a submenu should be a #GtkModelButton to switch back to the parent menu. Such a button should use the #GtkModelButton:inverted and #GtkModelButton:centered properties to achieve a title-like appearance and place the submenu indicator at the opposite side. To switch back to the main menu, use "main" as the menu name.
Example
Just like normal popovers created using gtk_popover_new_from_model, #GtkPopoverMenu instances have a single css node called "popover" and get the .menu style class.