Tk Source Code

Artifact [2b68fb74]
Login

Artifact 2b68fb74215a536868537e21df5b86c0588cd28c8293f6dbd896931696add2f6:

Attachment "exercise.tcl" to ticket [280189e3] added by erikleunissen 2025-08-14 10:37:47.
package require Tk
tk appname foo
set fd [open "|[info nameofexecutable]" r+]
puts $fd "package require Tk; tk appname foo"; flush $fd
puts $fd {puts [tk appname]; flush stdout}; flush $fd
set appname_child [gets $fd]
puts "State before child exit:\nwinfo interps: |[winfo interps]|\ntk appname parent: [tk appname]\ntk appname child: $appname_child"
puts $fd exit; flush $fd
close $fd
puts "\nState after child exit:\nwinfo interps: |[winfo interps]|"