Gtk.PopoverMenuBar¶
- Subclasses:
None
Methods¶
- Inherited:
Gtk.Widget (181), GObject.Object (37), Gtk.Accessible (15), 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
GtkPopoverMenuBar
presents a horizontal bar of items that pop up popover menus when clicked.An example
Gtk.PopoverMenuBar
The only way to create instances of
GtkPopoverMenuBar
is from aGMenuModel
.- CSS nodes
`` 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.
- Accessibility
GtkPopoverMenuBar
uses theGtk.AccessibleRole.MENU_BAR
role, the menu items use theGtk.AccessibleRole.MENU_ITEM
role and the menus use theGtk.AccessibleRole.MENU
role.- classmethod new_from_model(model)[source]¶
- Parameters:
model (
Gio.MenuModel
orNone
) – aGMenuModel
- Returns:
a new
GtkPopoverMenuBar
- Return type:
Creates a
GtkPopoverMenuBar
from aGMenuModel
.
- add_child(child, id)[source]¶
- Parameters:
child (
Gtk.Widget
) – theGtkWidget
to addid (
str
) – the ID to insert child at
- Returns:
True
if 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
custom
attribute 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
) – theGtkWidget
to remove- Returns:
True
if 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.MenuModel
orNone
) – aGMenuModel
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
GMenuModel
from which the menu bar is created.The model should only contain submenus as toplevel elements.