MenuItem
classin packageklyn.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 isCheckable
isCheckable as Boolean = false
Whether activating the item toggles its checked state.
public property isChecked
isChecked as Boolean = false
Current checked state of a checkable menu item.
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, isCheckable as Boolean = false, isChecked as Boolean = false ):
Creates a menu item.
Methods
Modifier and Type Member Description
public activate
activate() as Void:
Activates the item through the menu infrastructure.
public click
click() as Void:
Executes the menu action.