MenuItemWithIcon class
📖 Description​
The MenuItemWithIcon class defines a menu item (with an icon) for the Menu class. A menu item is a selectable item in the menu that executes a function when tapped/clicked. It is derived from the MenuItem class.
🆕 constructor​
Creates a new MenuItemWithIcon instance.
Signature​
constructor(
icon: number,
label: string,
fn?: () => void,
disabled?: boolean
): MenuItemWithIcon
Parameters​
| Name | Type | Optional | Description |
|---|---|---|---|
icon | number | No | Specifies the icon. |
label | string | No | Specifies the label. |
fn | () => void | Yes | Specifies the command which is invoked when the item is selected. |
disabled | boolean = false | Yes | Specifies if the item is disabled (default is false). |
Return value​
Returns a reference to the new MenuItemWithIcon instance.