The window.cursor property affects only the window client area. The title bar and borders are not affected.
Window.cursor
Get or set the image of the mouse cursor as it hovers over the window. Mouse cursors are represented by strings :
- "arrow" : the default Windows mouse cursor.
- "cross" : a crosshair cursor.
- "working" : the standard arrow with a small hourglass.
- "hand" : a hand cursor.
- "help" : the standard arrow with a small question mark.
- "ibeam" : the default I-Beam text cursor.
- "forbidden" : a slashed circle cursor.
- "cardinal" : a four-pointed arrow pointing up, down, right, and left.
- "horizontal" : a double-pointed arrow pointing right and left.
- "vertical" : a double-pointed arrow pointing up and down.
- "leftdiagonal" : a double-pointed arrow pointing topright down to the left.
- "rightdiagonal" :a double-pointed arrow pointing topleft down to the right.
- "up" : an arrow pointing up.
- "wait" : a hourglass cursor.
- "none" or
nil: no cursor is displayed.
Example
--! luart-extensions
import ui
-- create a simple window
local win = ui.Window("Window.cursor sample", 320, 200)
win:show()
win:status("Hover the window to view the 'hand' cursor !")
-- set the mouse cursor when hovering the window
win.cursor = "hand"
-- update user interface
repeat
ui.update()
until not win.visible