Fantom

 

class

fwt::MenuItem

sys::Obj
  fwt::Widget
    fwt::MenuItem

@js

MenuItem is an individual item on a Menu.

Slots

acceleratorSource

native Key? accelerator

Accelerator for menu item.

commandSource

Command? command

Command associated with this menu item. Setting the command automatically maps the text, icon, enable state, and eventing to the command.

imageSource

native Image? image

Image to display on menu item. Defaults to null.

makeSource

new make(|MenuItem|? f := null)

Default constructor.

makeCommandSource

new makeCommand(Command c)

Make a menu item for the specified command.

modeSource

const MenuItemMode mode := ...

Mode defines the menu item's style. Normal items are one of check, push, radio, or sep. The default is push. All instances of Menu have a mode of menu. This field cannot be changed once the item is constructed.

onActionSource

@transient
readonly EventListeners onAction := EventListeners()

Callback function when menu is selected.

Event id fired:

Event fields:

  • none
selectedSource

native Bool selected

The button's selection state (if check or radio). Defaults to false.

textSource

native Str text

Text of the menu item's label. Defaults to "".