Button:onContext() event


This event is fired when the user has clicked on the Button with the right mouse button.

Return value

The event returns no value.

Example

local ui = require "ui" -- create a window local win = ui.Window("Button:onContext() sample", 320, 200) local button = ui.Button(win, "Right-click on this Button !", 80, 75) -- set a onContext() event : change the Button text function button:onContext() self.text = "Good job !" end win:show() while win.visible do ui.update() end