Progressbar.width read/write property
Get or set the Progressbar area width. The width starts from 0 (left side of the Progressbar) and increases to the right direction.
Example
local ui = require "ui"
-- create a simple Window
local win = ui.Window("Progressbar.width sample", 360, 200)
local pb = ui.Progressbar(win, 50)
local inc_btn = ui.Button(win, "Increase Progressbar.width !", 15, 50)
local dec_btn = ui.Button(win, "Decrease Progressbar.width", inc_btn.x+inc_btn.width+10, inc_btn.y)
local function onClick(self)
local delta
if self == inc_btn then
delta = 10
else
delta = -10
end
pb.width = pb.width + 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