Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: MenuItem

[12:7] extends: Node, Control

Wraps JavaFX MenuItem, a single selectable item in a Menu or ContextMenu that triggers an action when chosen. Each item displays a text label and optionally an image graphic. Register a click handler with onClick() to respond when the user selects the item. MenuItem is the base type for more specialized items such as CheckMenuItem and RadioMenuItem.

Methods

  • MenuItem (string Name, Img = null)

    Initializes a new MenuItem with the specified name and optional image.

    • @p Name The name displayed on the menu item.
    • @p Img An optional Image object to display with the menu item.
    • @r this object
  • onClick (callback OnClick)

    Sets a callback function to execute when the menu item is clicked.

    • @p OnClick The callback function for the click event.
    • @r void