Combobox.selected readonly property


Get or set the current selected ComboItem or nil if no selection has been made.

Example

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