Mouse position: Difference between revisions

Content added Content deleted
Line 1,461: Line 1,461:
set y [expr {[winfo pointery .] - [winfo rooty $curWindow]}]
set y [expr {[winfo pointery .] - [winfo rooty $curWindow]}]
tk_messageBox -message "the mouse is at ($x,$y) in window $curWindow"</lang>
tk_messageBox -message "the mouse is at ($x,$y) in window $curWindow"</lang>



screen coordinates
screen coordinates
<lang tcl>package require Tk
<lang tcl>puts "monitor/display coordinate x = [winfo pointerx .]"</lang>
puts "monitor/display coordinate x = [winfo pointerx .]"</lang>


=={{header|Visual Basic}}==
=={{header|Visual Basic}}==