MenuItem
class in package klyn.gui.windows

    public class MenuItem:

MenuItem

Single menu entry.

Subclasses may override `click` to implement actions while keeping the menu infrastructure generic.

    item = MenuItem("Open...")

Properties

Modifier and Type | Member | Description
--- | --- | ---
public property | icon `icon as String = ""` | Short visual marker drawn before the menu text.
public property | isEnabled `isEnabled as Boolean = true` | Whether the entry can be selected and activated.
public property | isSeparator `isSeparator as Boolean = false` | Whether this entry is a visual separator between action groups.
public property | shortcut `shortcut as String = ""` | Human-readable shortcut displayed at the right of the menu item.
public property | subMenu `subMenu as Menu = null` | Child menu opened from this item.
public property | text `text as String = ""` | Display text shown in the menu popup.

Constructors

Modifier and Type | Member | Description
--- | --- | ---
public | MenuItem `MenuItem(text as String = "", icon as String = "", shortcut as String = "", subMenu as Menu = null):` | Creates a menu item.

Methods

Modifier and Type | Member | Description
--- | --- | ---
public | click `click() as Void:` | Executes the menu action.