Progressbar:onClick(x, y) event
This event is fired when the user has clicked on the Progressbar.
Parameters
x
The horizontal position of the mouse in the Progressbar area.
y
The vertical position of the mouse in the Progressbar area.
Return value
The event returns no value.Example
local ui = require "ui"
-- create a window
local win = ui.Window("Progressbar:onClick() sample", 320, 200)
win:status("Click on the Progress bar !")
local pb = ui.Progressbar(win)
pb:center()
-- set a onClick() event : change the pb text property
function pb:onClick(x, y)
win:status("Good Job ! You have clicked at position "..x..", "..y)
self.position = 100
end
win:show()
while win.visible do
ui.update()
end