MenuItem.text read/write

Get or set the MenuItem caption as a string.

To create a menu separator, set this property to an empty string ""

Example

local ui = require "ui" -- create a simple Window local win = ui.Window("MenuItem.text sample", 316, 246) local menu = ui.Menu("Item 1", "Item 2", "Item 3", "Quit") -- shows popup menu on right click function win:onContext() win:popup(menu) end -- set a Menu onClick() event handler function menu:onClick(item) if item.index == self.count then win.visible = false else ui.info("You have selected '"..item.text.."'") end 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