List.width read/write property
Get or set the List width. The width starts from 0 (left side of the List) and increases to the right direction.
Example
local ui = require "ui"
-- create a simple Window
local win = ui.Window("List.width sample", 320, 200)
local list = ui.List(win, {"Item 1", "Item 2"}, 120, 20)
local inc_btn = ui.Button(win, "Increase List.width", 40, 130)
local dec_btn = ui.Button(win, "Decrease List.width", inc_btn.x+inc_btn.width+6, inc_btn.y)
inc_btn.delta = 10
dec_btn.delta = -10
local function onClick(self)
list.width = list.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