The list.visible property is also affected by the List:show() and List:hide() methods.
List.visible read/write property
Get or set the List visibility on screen, a true value means that the List is shown, a false value means that the List is hidden.
Example
local ui = require "ui"
-- create a simple list
local win = ui.Window("List.visible sample", 320, 200)
local list = ui.List(win, {"LuaRT"}, 120, 70)
local button = ui.Button(win, "Click to hide list", 110, 10)
list.font = "Impact"
list.fontsize = 18
-- hides the list and shows it again after 2 sec
function button:onClick()
list.visible = false
button.enabled = false
list(2000)
button.enabled = true
list.visible = true
end
win:show()
-- update the user interface until the user closes the list
repeat
ui.update()
until not win.visible