PopoverMenu#

class ignis.widgets.Widget.PopoverMenu(*args: Any, **kwargs: Any)#

Bases: Gtk.PopoverMenu

A dropdown menu consisting of a list of MenuItem. It must be added as a child to a container. To display it, call the popup() method.

Widget.PopoverMenu(
    items=[
        Widget.MenuItem(
            label="Just item",
            on_activate=lambda x: print("item activated!"),
        ),
        Widget.MenuItem(
            label="This is disabled item",
            enabled=False,
            on_activate=lambda x: print("you will not see this message in terminal hehehehehe"),
        ),
        Widget.MenuItem(
            label="This has submenu!",
            on_activate=lambda x: print("anyway activate callback working"),
            submenu=Widget.PopoverMenu(items=[Widget.MenuItem(label=str(i)) for i in range(10)])
        ),
    ]
)
property items: list[MenuItem]#
  • optional, read-write

A list of MenuItem.