MenuItem#
- class ignis.widgets.Widget.MenuItem(label: str, enabled: bool = True, on_activate: Callable | None = None, submenu: gi.repository.Gtk.PopoverMenu | None = None)#
Bases:
IgnisGObject
Danger
This is not a regular widget. It doesn't support common widget properties and cannot be added as a child to a container.
A class that represent a menu item. Intended for use in
PopoverMenu
.Widget.MenuItem( label="item 1", enabled=True, on_activate=lambda x: print("menu item 1 activated!"), submenu=Widget.PopoverMenu() )
- property enabled: bool#
optional, read-write
Whether the item is enabled. If
False
, the item cannot be selected.
- property on_activate: Callable#
optional, read-write
The function to call when the user clicks on the item.
- property submenu: gi.repository.Gtk.PopoverMenu | None#
optional, read-only
The
PopoverMenu
that will appear when activated.