Top | ![]() |
![]() |
![]() |
![]() |
GtkPopoverMenuBar implements GtkAccessible, GtkBuildable and GtkConstraintTarget.
GtkPopoverMenuBar presents a horizontal bar of items that pop up popover menus when clicked.
The only way to create instances of GtkPopoverMenuBar is from a GMenuModel.
1 2 3 4 5 |
menubar ├── item[.active] ┊ ╰── popover ╰── item ╰── popover |
GtkPopoverMenuBar has a single CSS node with name menubar, below which each item has its CSS node, and below that the corresponding popover.
The item whose popover is currently open gets the .active style class.
GtkPopoverMenuBar uses the GTK_ACCESSIBLE_ROLE_MENU_BAR role, the menu items use the GTK_ACCESSIBLE_ROLE_MENU_ITEM role and the menus use the GTK_ACCESSIBLE_ROLE_MENU role.
GtkWidget *
gtk_popover_menu_bar_new_from_model (GMenuModel *model
);
Creates a GtkPopoverMenuBar from a GMenuModel.
void gtk_popover_menu_bar_set_menu_model (GtkPopoverMenuBar *bar
,GMenuModel *model
);
Sets a menu model from which bar
should take
its contents.
GMenuModel *
gtk_popover_menu_bar_get_menu_model (GtkPopoverMenuBar *bar
);
Returns the model from which the contents of bar
are taken.
gboolean gtk_popover_menu_bar_add_child (GtkPopoverMenuBar *bar
,GtkWidget *child
,const char *id
);
Adds a custom widget to a generated menubar.
For this to work, the menu model of bar
must have an
item with a custom
attribute that matches id
.
gboolean gtk_popover_menu_bar_remove_child (GtkPopoverMenuBar *bar
,GtkWidget *child
);
Removes a widget that has previously been added with
gtk_popover_menu_bar_add_child()
.
“menu-model”
property“menu-model” GMenuModel *
The GMenuModel from which the menu bar is created.
The model should only contain submenus as toplevel elements.
Owner: GtkPopoverMenuBar
Flags: Read / Write