Window:onContext() event


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

Return value

The event returns no value.

Example

local ui = require "ui" -- create a window local win = ui.Window("Window:onContext() sample", 320, 200) local label = ui.Label(win, "Right-click on the Window !", 100, 75) -- set a onContext() event : display a popup menu at the current mouse location function win:onContext() win:popup(ui.Menu("Item 1", "Item 2", "Item 3")) end win:show() while win.visible do ui.update() end