Menu.items
Provides access to the list of Menu items.
Example
--! luart-extensions
import ui
-- create a simple Window
local win = ui.Window("Menu.items sample", 316, 246)
local menu = ui.Menu()
menu.items = { "Item1", "Item2", "Item3" }
-- shows popup menu on right click
function win:onContext()
win:popup(menu)
end
-- set a Menu:onClick() event handler
function menu:onClick(item)
ui.info("You have clicked on '"..item.text.."'")
end
win:status("Right-click on the Window to show a popup Menu")
-- shows the Window
win:show()
-- update user interface
repeat
ui.update()
until not win.visible