Tk Source Code

Artifact [cdecab8a]
Login

Artifact cdecab8a544af7e29d33bf041e2d87de3840e6bfaf6ae3add6f7180719b5d603:

Attachment "exercise.tcl" to ticket [591829e9] added by erikleunissen 2026-02-15 15:24:43.
if {[lindex $argv 0] eq "getPointerWin"} {
    package require Tk
    # Determine the pointer window before the Tk root window is mapped.
    set result "|[winfo containing [winfo pointerx .] [winfo pointery .]]|"
    # Determine the pointer window once more after having it withdrawn explicitly.
    wm withdraw .
    after 10; update
    append result "[winfo containing [winfo pointerx .] [winfo pointery .]]|"
    puts $result
    exit
}

# Move the screen pointer to the position on the screen where Tk displays
# the root window.
package require Tk
update
event generate . <Motion> -warp 1 -x 50 -y 50
after 10; update
puts [exec [info nameofexecutable] exercise.tcl getPointerWin]
exit