Combobox.width read/write property
Get or set the Combobox width. The width starts from 0 (left side of the Combobox) and increases to the right direction.
Example
local ui = require "ui"
-- create a simple Window
local win = ui.Window("Combobox.width sample", 320, 200)
local combobox = ui.Combobox(win, {"Item 1", "Item 2"}, 30, 60)
combobox.text = ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
local inc_btn = ui.Button(win, "Increase Combobox.width !", 4, 90)
local dec_btn = ui.Button(win, "Decrease Combobox.width", inc_btn.x+inc_btn.width+6, inc_btn.y)
inc_btn.delta = 10
dec_btn.delta = -10
local function onClick(self)
combobox.width = combobox.width + self.delta
end
inc_btn.onClick = onClick
dec_btn.onClick = onClick
-- shows the Window
win:show()
-- update user interface
repeat
ui.update()
until not win.visible