MenuItem¶
Overview¶
MenuItem is an item in the PhetMenu.
@author Michael Kauzmann (PhET Interactive Simulations)
Class MenuItem¶
Constructor¶
new MenuItem( closeCallback : ( event: SceneryEvent | null ) => void, labelStringProperty : TReadOnlyProperty<string>, callback : ( event: SceneryEvent | null ) => void, present : boolean, shouldBeHiddenWhenLinksAreNotAllowed : boolean, providedOptions? : MenuItemOptions )¶
Instance Methods¶
dispose()¶
Instance Properties¶
present : boolean¶
(readonly)
if this MenuItem will be shown in the menu. Some items are just created to maintain a consistent PhET-iO API for all sim runtimes, see https://github.com/phetsims/phet-io/issues/1457
separatorBefore : boolean¶
(readonly)
if there should be a horizontal separator between this MenuItem and the one above it
Type MenuItemOptions¶
- separatorBefore?: boolean
if there should be a horizontal separator between this MenuItem and the one immediately previous - checkedProperty?: TProperty<boolean> | null
if provided add a checkmark next to the MenuItem text whenever this Property is true. - textFill?: TPaint
- & VoicingOptions & NodeOptions
Source Code¶
See the source for MenuItem.ts in the sun repository.