MenuItem#
- class ignis.widgets.Widget.MenuItem(*args: Any, **kwargs: Any)#
Bases: :class:
ignis.gobject.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
.- Properties:
label (
str
, required, read-only): The label of item.enabled (
bool
, optional, read-only): Whether the item is enabled. IfFalse
, the item cannot be selected.on_activate (
Callable
, optional, read-write): Function to call when the user clicks on the item.submenu (
PopoverMenu
, optional, read-only): ThePopoverMenu
that will appear when activated.
Widget.MenuItem( label="item 1", enabled=True, on_activate=lambda x: print("menu item 1 activated!"), submenu=Widget.PopoverMenu() )