Gtk.PopoverMenuBar¶
- Subclasses:
- None 
Methods¶
- Inherited:
- Gtk.Widget (183), GObject.Object (37), Gtk.Accessible (17), Gtk.Buildable (1) 
- Structs:
| class | 
 | 
| 
 | |
| 
 | |
| 
 | 
Virtual Methods¶
- Inherited:
- Gtk.Widget (25), GObject.Object (7), Gtk.Accessible (6), Gtk.Buildable (9) 
Properties¶
- Inherited:
| Name | Type | Flags | Short Description | 
|---|---|---|---|
| r/w | 
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class Gtk.PopoverMenuBar(**kwargs)¶
- Bases:
- Abstract:
- No 
 - Presents a horizontal bar of items that pop up menus when clicked. - <picture> <source srcset=”menubar-dark.png” media=”(prefers-color-scheme: dark)”> <img alt=”An example - Gtk.PopoverMenuBar" src=”menubar.png”> </picture>- The only way to create instances of - GtkPopoverMenuBaris from a- GMenuModel.- CSS nodes
 - `` menubar ├── item[.active] ┊ ╰── popover ╰── item - ╰── popover - GtkPopoverMenuBarhas 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. - Accessibility
 - GtkPopoverMenuBaruses the [enum`Gtk`.AccessibleRole.menu_bar] role, the menu items use the [enum`Gtk`.AccessibleRole.menu_item] role and the menus use the [enum`Gtk`.AccessibleRole.menu] role.- classmethod new_from_model(model)[source]¶
- Parameters:
- model ( - Gio.MenuModelor- None) – a- GMenuModel
- Returns:
- a new - GtkPopoverMenuBar
- Return type:
 - Creates a - GtkPopoverMenuBarfrom a- GMenuModel.
 - add_child(child, id)[source]¶
- Parameters:
- child ( - Gtk.Widget) – the- GtkWidgetto add
- id ( - str) – the ID to insert child at
 
- Returns:
- Trueif id was found and the widget added
- Return type:
 - Adds a custom widget to a generated menubar. - For this to work, the menu model of self must have an item with a - customattribute that matches id.
 - get_menu_model()[source]¶
- Returns:
- a - GMenuModel
- Return type:
 - Returns the model from which the contents of self are taken. 
 - remove_child(child)[source]¶
- Parameters:
- child ( - Gtk.Widget) – the- GtkWidgetto remove
- Returns:
- Trueif the widget was removed
- Return type:
 - Removes a widget that has previously been added with - Gtk.PopoverMenuBar.add_child().
 - set_menu_model(model)[source]¶
- Parameters:
- model ( - Gio.MenuModelor- None) – a- GMenuModel
 - Sets a menu model from which self should take its contents. 
 
Property Details¶
- Gtk.PopoverMenuBar.props.menu_model¶
- Name:
- menu-model
- Type:
- Default Value:
- Flags:
 - The - GMenuModelfrom which the menu bar is created.- The model should only contain submenus as toplevel elements.