Progressbar.constructor(parent, [x], [y], [width], [height]) constructor


The Progressbar constructor returns a Progressbar instance to indicate the progress of a lengthy operation.

Parameters

parent

An object that will own the Progressbar. Parent objects can be any of Window, Groupbox, TabItem and Panel

x

An optional number that indicates the Progressbar horizontal position, in pixels. Zero means the left border of the parent.

y

An optional number that indicates the Progressbar vertical position, in pixels. Zero means the top border of the parent.

width

An optional number that indicates the Progressbar width in pixels, autosized to fit text content if omitted.

height

An optional number that indicates the Progressbar height in pixels, autosized to fit text content if omitted.

Example

local ui = require "ui" -- create a simple Window local win = ui.Window("Progressbar.constructor() sample", 320, 200) -- create a themed Progressbar local pb = ui.Progressbar(win, 130, 80) pb.themed = false pb:center() pb.fgcolor = 0x5050FF win:show() -- update the user interface until the user closes the Window repeat pb:advance(1) ui.update() until not win.visible