Radiobutton:onContext() event
This event is fired when the user has clicked on the Radiobutton with the right mouse radiobutton.
Return value
The event returns no value.Example
local ui = require "ui"
-- create a window
local win = ui.Window("Radiobutton:onContext() sample", 320, 200)
local radiobutton = ui.Radiobutton(win, "Right-click on this Radiobutton !", 80, 75)
-- set a onContext() event : display a dynamic popupmenu
function radiobutton:onContext()
local popupmenu = ui.Menu()
popupmenu:add(self.checked and "Uncheck this item" or "Check this item").onClick = function ()
radiobutton.checked = not radiobutton.checked
end
self.parent:popup(popupmenu)
end
win:show()
while win.visible do
ui.update()
end