The Menu class represents a menu component.
A Menu inherits from Component and Object. It provides access to the root MenuItem object through the Items property or the getItems() method.
Inheritance[edit]
| Class
|
Inherits From
|
Description
|
| Menu
|
Component
|
A menu component that provides access to its root MenuItem.
|
| Component
|
Object
|
Base class for components.
|
Properties[edit]
| Property
|
Type
|
Description
|
| Items
|
MenuItem
|
The base MenuItem object of this menu. This property is read-only.
|
Methods[edit]
| Method
|
Return Type
|
Description
|
| getItems()
|
MenuItem
|
Returns the main MenuItem object of this menu.
|
Examples[edit]
local form = createForm()
local menu = createMainMenu(form)
form.Menu = menu
local root = menu.Items
local fileItem = createMenuItem(menu)
fileItem.Caption = "File"
root.add(fileItem)
form.show()
local form = createForm()
local menu = createMainMenu(form)
form.Menu = menu
local root = menu.getItems()
local item = createMenuItem(menu)
item.Caption = "Example"
root.add(item)
form.show()
Core Lua documentation entry points