Window:onClick(x, y) event


This event is fired when the user has clicked on the window.

Parameters

x

The horizontal position of the mouse in the window's client area.

y

The vertical position of the mouse in the window's client area.

Return value

The event returns no value.

Example

local ui = require "ui" -- create a window local win = ui.Window("Window:onClick() sample", 320, 200) local label = ui.Label(win, "Click on the Window !", 100, 75) -- set a onClick() event : display a status bar with the mouse position when the user has clicked function win:onClick(x, y) win:status("Mouse position : "..x..", "..y) end win:show() while win.visible do ui.update() end