Picture:onContext() event
This event is fired when the user has clicked on the Picture with the right mouse button.
Return value
The event returns no value.Example
local ui = require "ui"
-- create a simple window
local win = ui.Window("Picture:onContext() sample", 340, 180)
local picture = ui.Picture(win, "examples/LuaRT.png", -74)
local menu = ui.Menu("Change picture")
function menu:onClick()
local file = ui.opendialog("Open picture...", false, "All files (*.*)|*.*|PNG image files (*.png)|*.png|JPEG image files (*.jpg)|*.jpg|Bitmap image files (*.bmp)|*.bmp|GIF image files (*.gif)|*.gif|ICO image files (*.ico)|*.ico|TIFF image files (*.tiff)|*.tiff")
if file ~= nil then
picture:load(file)
end
end
function picture:onContext()
win:popup(menu)
end
win:show()
repeat
ui.update()
until win.visible == false