Fantom

 

class

fwt::Menu

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

@js

Menu contains MenuItems. Menu is also itself a MenuItem when nested inside other Menus.

Slots

addSource

override This add(Widget? kid)

Overrides fwt::Widget.add

Doc inherited from fwt::Widget.add

Add a child widget. If child is null, then do nothing. If child is already parented throw ArgErr. Return this.

addCommandSource

MenuItem addCommand(Command c)

Add a menu item for the specified command. Default implementation is to add an item without the icon.

addSepSource

Void addSep()

Add a separator to the menu.

makeSource

new make()

Default constructor.

onOpenSource

@transient
readonly EventListeners onOpen := EventListeners()

Callback function when menu is opened. This callback provides a change to build a lazily populated menu.

Event id fired:

Event fields:

  • none
openSource

native This open(Widget parent, Point pos)

Open this menu as a popup at the coordinates relative to the parent widget. This method blocks until the menu is closed.