Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: CheckMenuItem

[12:7] extends: FxObj

Wraps JavaFX CheckMenuItem, a menu item with a checkmark toggle that tracks a selected/unselected state. When the user clicks the item, the checkmark toggles and the state is retained until changed again. Use setSelected() to set the initial state programmatically and getSelected() to read it. An onClick() callback fires each time the item is clicked.

Methods

  • CheckMenuItem (string Text = "")

    Creates a new CheckMenuItem with the specified text.

    • @p Text is a string with the menu item label.
  • setSelected (bool Selected)

    Sets the selected state.

    • @p Selected is a bool with true to check.
    • @r this object for chaining
  • getSelected ()

    Gets the selected state.

    • @r A bool with true if checked.
  • onClick (callback OnClick)

    Sets a callback for when the item is clicked.

    • @p OnClick is a callback to call on click.
    • @r this object for chaining