[9:7] extends: Node, Control
Represents a JavaFX MenuItem, a selectable item within a Menu. The MenuItem class supports setting a display name, an optional image, and click events.
MenuItem (string Name, Img = null
)
Initializes a new MenuItem with the specified name and optional image.
Name
The name displayed on the menu item.Img
An optional Image object to display with the menu item.this
objectonClick (callback OnClick
)
Sets a callback function to execute when the menu item is clicked.
OnClick
The callback function for the click event.void