Tk Source Code

Artifact [e020662b]
Login

Artifact e020662bd30eafd4389f67951eefed4d1b686797eb86ad965a8b9eba7b46585e:

Attachment "exercise.tcl" to ticket [591829e9] added by erikleunissen 2026-03-03 23:28:44.
if {[lindex $argv 0] eq "getPointerWin"} {
    package require Tk
    set result "|[winfo ismapped .]|[wm state .]|"
    # Determine the pointer window before the Tk root window is mapped.
    append result "[winfo containing [winfo pointerx .] [winfo pointery .]]|"
    # Determine the pointer window once more after having explicitly withdrawn
    # the root window.
    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
wm withdraw .
after 10; update
puts [exec [info nameofexecutable] exercise.tcl getPointerWin]
exit