Tab.items readonly


Provides access to the list of Tab items.

Example

--! luart-extensions import ui -- create a simple Window local win = ui.Window("Tab.items sample", 464, 232) local label = ui.Label(win, "Enter an item index : ", 20, 30) local entry = ui.Entry(win, "1", label.x+label.width+6, label.y-4, 22, 22) local tab = ui.Tab(win, {}, entry.x+entry.width+6, label.y-4) -- change all items in the tab tab.items = { "LuaRT", "is", "fun"} -- disable the tab tab.enabled = false -- Event fired when user press RETURN in the Entry field function entry:onSelect() local item = tab.items[entry.text] or false if item then tab.selected = item else ui.error(entry.text.." is not a valid index") end print("Selected item = "..item.text) end win:show() -- update user interface repeat ui.update() until not win.visible