Skip to main content
Ctrl+K

Ignis

  • User guide
  • API reference
  • Developer Guide
  • Examples
  • GitHub
  • User guide
  • API reference
  • Developer Guide
  • Examples
  • GitHub

Section Navigation

  • Application
  • GObject
  • Variable
  • Client
  • Options
  • Options Manager
  • Exceptions
  • D-Bus
  • D-Bus menu
  • BaseWidget
  • BaseService
  • Connection Manager
  • Widgets
    • Arrow
    • ArrowButton
    • Box
    • Button
    • Calendar
    • CenterBox
    • CheckButton
    • DropDown
    • Entry
    • EventBox
    • FileChooserButton
    • FileDialog
    • FileFilter
    • Grid
    • HeaderBar
    • Icon
    • Label
    • ListBox
    • ListBoxRow
    • MenuItem
    • Overlay
    • Picture
    • PopoverMenu
    • RegularWindow
    • Revealer
    • RevealerWindow
    • Scale
    • Scroll
    • Separator
    • SpinButton
    • Stack
    • Switch
    • ToggleButton
    • Window
  • Services
    • Applications
    • Audio
    • Backlight
    • Bluetooth
    • Fetch
    • Hyprland
    • MPRIS (media)
    • Network
    • Niri
    • Notifications
    • Recorder
    • System Tray
    • Systemd
    • UPower
    • Wallpaper
  • Utils
    • FileMonitor
    • Poll
    • Timeout
    • Debounce
    • File
    • Icon
    • Misc
    • Monitor
    • Pixbuf
    • Sass
    • Shell Commands
    • Socket
    • String Cases
    • Thread
    • Version
  • API reference
  • Widgets
  • MenuItem

MenuItem#

class ignis.widgets.Widget.MenuItem(label: str, enabled: bool = True, on_activate: Callable | None = None, submenu: 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.

Parameters:
  • label -- The label of item.

  • enabled (default: True) -- Whether the item is enabled. If False, the item cannot be selected.

  • on_activate (default: None) -- The function to call when the user clicks on the item.

  • submenu (default: None) -- The PopoverMenu that will appear when activated.

Widget.MenuItem(
    label="item 1",
    enabled=True,
    on_activate=lambda x: print("menu item 1 activated!"),
    submenu=Widget.PopoverMenu()
)
gproperty label: str#
  • read-only

The label of item.

gproperty uniq_name: str#
  • read-only

The unique name of the Gio.Action.

gproperty enabled: bool#
  • read-only

Whether the item is enabled. If False, the item cannot be selected.

gproperty on_activate: Callable#
  • read-write

The function to call when the user clicks on the item.

gproperty submenu: Gtk.PopoverMenu | None#
  • read-only

The PopoverMenu that will appear when activated.

previous

ListBoxRow

next

Overlay

On this page
  • MenuItem
    • MenuItem.label
    • MenuItem.uniq_name
    • MenuItem.enabled
    • MenuItem.on_activate
    • MenuItem.submenu
Edit on GitHub

This Page

  • Show Source

© Copyright 2024, linkfrg.

Created using Sphinx 8.1.0.

Built with the PyData Sphinx Theme 0.16.1.