ListItem.text read/write

Get or set the item caption as a string.

Example

local ui = require "ui" -- create a simple Window local win = ui.Window("ListItem.text sample", "fixed", 360, 150) local label = ui.Label(win, "Select an item :", 90, 30) local list = ui.List(win, {"LuaRT", "is", "fun !"}, label.x+label.width+6, label.y-4) -- set the selected item to the first item "LuaRT" list.selected = list.items[1] function list:onSelect(item) -- update window status with the item caption win:status("You have selected = "..item.text) end win:show() -- update user interface repeat ui.update() until not win.visible