Top | ![]() |
![]() |
![]() |
![]() |
GtkWidget * | gtk_popover_menu_new_from_model () |
void | gtk_popover_menu_set_menu_model () |
GMenuModel * | gtk_popover_menu_get_menu_model () |
GObject ╰── GInitiallyUnowned ╰── GtkWidget ╰── GtkContainer ╰── GtkBin ╰── GtkPopover ╰── GtkPopoverMenu
GtkPopoverMenu implements AtkImplementorIface, GtkBuildable, GtkConstraintTarget, GtkShortcutManager and GtkNative.
GtkPopoverMenu is a subclass of GtkPopover that treats its children like menus and allows switching between them. It can open submenus as traditional, nested submenus, or in a more touch-friendly sliding fashion.
GtkPopoverMenu is meant to be used primarily with menu models,
using gtk_popover_menu_new_from_model()
. If you need to put other
widgets such as GtkSpinButton or GtkSwitch into a popover,
use a GtkPopover.
In addition to all the regular menu model features, this function supports rendering sections in the model in a more compact form, as a row of image buttons instead of menu items.
To use this rendering, set the ”display-hint” attribute of the section to ”horizontal-buttons” and set the icons of your items with the ”verb-icon” attribute.
GtkPopoverMenu is just a subclass of GtkPopover that adds custom content to it, therefore it has the same CSS nodes. It is one of the cases that add a .menu style class to the popover's main node.
GtkWidget *
gtk_popover_menu_new_from_model (GMenuModel *model
);
Creates a GtkPopoverMenu and populates it according to
model
.
The created buttons are connected to actions found in the GtkApplicationWindow to which the popover belongs - typically by means of being attached to a widget that is contained within the GtkApplicationWindows widget hierarchy.
Actions can also be added using gtk_widget_insert_action_group()
on the menus attach widget or on any of its parent widgets.
This function creates menus with sliding submenus.
See gtk_popover_menu_new_from_model_full()
for a way
to control this.
void gtk_popover_menu_set_menu_model (GtkPopoverMenu *popover
,GMenuModel *model
);
Sets a new menu model on popover
.
The existing contents of popover
are removed, and
the popover
is populated with new contents according
to model
.
GMenuModel *
gtk_popover_menu_get_menu_model (GtkPopoverMenu *popover
);
Returns the menu model used to populate the popover.