List:onChange() event


This event is fired when items have been modified in the List.

Return value

The event returns no value.

Example

local ui = require "ui" -- create a simple Window local win = ui.Window("List:onChange() sample", 320, 200) local label = ui.Label(win, "Choose a number : ", 60, 40) local list = ui.List(win, {"10", "33", "77", "100"}, label.x+label.width+10, label.y-4) function list:onChange() win:status("List has changed !") end function list:onSelect(item) item.text = item.text + 1 end win:status("Choose a number to increment it") win:show() -- update user interface repeat ui.update() until not win.visible