Menu type (joe.win)


The Menu widget is a menu in a MenuBar or a submenu in a parent Menu. It contains MenuItem widgets.

Initializer

Methods

Properties

All Node widgets have the following properties.

PropertyTypeDescription
#idStringJavaFX ID
#styleStringFXCSS style string
#textStringMenu text

See Styling with CSS for more on using CSS.

Menu Initializer


Menu() → Menu

Returns a Menu.

Methods



menu.disable([flag]) → this

Sets the menu's #disable property to flag; if omitted, flag defaults to true. While true, this menu and its descendants in the scene graph will be disabled.


menu.getProperty(keyword) → value

Gets the value of the property with the given keyword.


menu.id(id) → this

Sets the menu's #id property to the given id string.


menu.isDisabled() → joe.Boolean

Returns true if the menu has been disabled, and false otherwise.


menu.item(item) → this

Adds a MenuItem or Menu to the menu.


menu.items() → joe.List

Gets the list of the menu's items, which can be updated freely. All items must be instances of MenuItem or Menu.


menu.listenTo(keyword, listener) → this

Adds a listener to the property with the given keyword. The listener should be a callable taking the three arguments:

  • The property keyword
  • The old value of the property
  • The new value of the property

The listener will be called when the property's value changes.


menu.properties() → joe.Set

Returns a readonly Set of the object's property keywords.


menu.setProperty(keyword, value) → this

Sets the value of the property with the given keyword. The value must be assignable to the property's value type.


menu.styleClasses() → joe.List

Gets the list of the menu's FXCSS style class names. Values must be valid CSS style class names.

See Styling with CSS for more on using CSS.


menu.styles(style, ...) → this

Sets the menu's FXCSS #style property. The caller can pass multiple style strings, which will be joined with semicolons.

See Styling with CSS for more on using CSS.


menu.text(text) → this

Sets the menu's text.


menu.toString() → joe.String

Returns the value's string representation.