Menu
type (joe.win
)
The Menu
widget is a menu in a MenuBar
or a submenu
in a parent Menu
. It contains MenuItem
widgets.
- menu.disable([flag]) → this
- menu.getProperty(keyword) → value
- menu.id(id) → this
- menu.isDisabled() → joe.Boolean
- menu.item(item) → this
- menu.items() → joe.List
- menu.listenTo(keyword, listener) → this
- menu.properties() → joe.Set
- menu.setProperty(keyword, value) → this
- menu.styleClasses() → joe.List
- menu.styles(style, ...) → this
- menu.text(text) → this
- menu.toString() → joe.String
Properties
All Node
widgets have the following properties.
See Styling with CSS for more on using CSS.
Menu Initializer
Menu() → Menu
Returns a Menu
.
Methods
menu.disable()
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()
menu.getProperty(keyword) → value
Gets the value of the property with the given keyword.
menu.id()
menu.id(id) → this
Sets the menu's #id
property to the given id string.
menu.isDisabled()
menu.isDisabled() → joe.Boolean
Returns true
if the menu has been disabled, and false
otherwise.
menu.item()
menu.item(item) → this
Adds a MenuItem
or Menu
to the menu.
menu.items()
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()
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()
menu.properties() → joe.Set
Returns a readonly Set
of the object's property keywords.
menu.setProperty()
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()
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()
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()
menu.text(text) → this
Sets the menu's text.
menu.toString()
menu.toString() → joe.String
Returns the value's string representation.