Canvas:onContext() event
This event is fired when the user has clicked on the Canvas with the right mouse button.
Return value
The event returns no value.Example
local ui = require "ui"
require "canvas"
local win = ui.Window("Canvas:onContext() event sample", "fixed", 320, 200)
win:status("Right click on the Canvas")
-- create a Canvas
local canvas = ui.Canvas(win, 0, 0, 100, 100)
canvas:center()
canvas.bgcolor = 0xFF0000FF
function canvas:onContext()
win:popup(ui.Menu("Item 1", "Item 2", "Item 3"))
end
ui.run(win):wait()