struct MenuItem
Swift
struct MenuItem
A menu item in a menubar description: text, an action, and optionally an id, a shortcut and a checkmark.
Sources/LavaMenu/Menu.swift:341
Constructors
init(_ title: String, id: MenuID? = nil, shortcut: KeyShortcut? = nil, isEnabled: Bool = true, isChecked: Bool? = nil, action: @escaping () -> Void)
Creates a menu item.
Sources/LavaMenu/Menu.swift:356
init(_ title: String, id: String, shortcut: KeyShortcut? = nil, isEnabled: Bool = true, isChecked: Bool? = nil, action: @escaping () -> Void)
String id convenience.
Sources/LavaMenu/Menu.swift:373
Properties
var action: () -> Void
What choosing the item does.
Sources/LavaMenu/Menu.swift:353
var id: MenuID?
The item's id, or nil to derive one from the menu path and title (file/save).
Sources/LavaMenu/Menu.swift:345
var isChecked: Bool?
nil for an ordinary item; true or false for a checkable one.
Sources/LavaMenu/Menu.swift:351
var isEnabled: Bool
Whether it can be activated.
Sources/LavaMenu/Menu.swift:349
var shortcut: KeyShortcut?
The item's keyboard shortcut.
Sources/LavaMenu/Menu.swift:347
var title: String
The item's text.
Sources/LavaMenu/Menu.swift:343