Tk Source Code

Artifact [4801358c]
Login

Artifact 4801358c3db02ea4c1b7f67fe3fd839dca36f628db8b0f48f5527cad1a25651a:

Attachment "active-window-repro.tcl" to ticket [595d72d0] added by 0xjnml 2026-10-04 14:55:30. (unpublished)
# Tk 9.1 on X11: which window does a screen reader see as active?
# Start a screen reader (or any process named "orca") first. After 3 s the
# script moves the focus to a second toplevel, and 1 s later back.
wm title . "Main window"
ttk::button .b -text Save
ttk::label .l -text Ready.
pack .b .l -padx 20 -pady 10
toplevel .second
wm title .second "Second window"
ttk::button .second.b -text Close
pack .second.b -padx 20 -pady 10
after 1000 {focus -force .b}
after 3000 {focus -force .second.b}
after 4000 {focus -force .b}