PopoverMenuBar

class PopoverMenuBar(**properties: Any)

Superclasses: Widget, InitiallyUnowned, Object

Implemented Interfaces: Accessible, Buildable, ConstraintTarget

Constructors:

PopoverMenuBar(**properties)
new_from_model(model:Gio.MenuModel=None) -> Gtk.Widget

Constructors

class PopoverMenuBar
classmethod new_from_model(model: MenuModel | None = None) Widget

Creates a GtkPopoverMenuBar from a GMenuModel.

Parameters:

model – a GMenuModel

Methods

class PopoverMenuBar
add_child(child: Widget, id: str) bool

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.

Parameters:
  • child – the GtkWidget to add

  • id – the ID to insert child at

get_menu_model() MenuModel | None

Returns the model from which the contents of bar are taken.

remove_child(child: Widget) bool

Removes a widget that has previously been added with add_child().

Parameters:

child – the GtkWidget to remove

set_menu_model(model: MenuModel | None = None) None

Sets a menu model from which bar should take its contents.

Parameters:

model – a GMenuModel

Properties

class PopoverMenuBar
props.menu_model: MenuModel

The GMenuModel from which the menu bar is created.

The model should only contain submenus as toplevel elements.