List:onSelect(ListItem) event
Event fired when the user has choosen an item in the List.
Return value
The event returns no value.Example
local ui = require "ui"
-- create a window
local win = ui.Window("List:onSelect() sample", 320, 200)
local label = ui.Label(win, "Name : ", 80, 55)
local list = ui.List(win, {"Sam", "Mary", "John"}, label.x + label.width + 8, label.y - 4, 100)
function list:onSelect(item)
ui.info("Welcome "..item.text.." !")
end
win:show()
while win.visible do
ui.update()
end