Tk Source Code

Artifact [8b8fc408]
Login

Artifact 8b8fc4085993807aa2845bc84885bc2d5c2ba7e4b4eeda945fb2373d3594fb47:

Attachment "hide.tcl" to ticket [40dc19ee] added by marc_culler 2026-10-20 14:18:58.
package require Tk

toplevel .a -bg red
wm geometry .a 200x200
update idletasks
puts "Here is a red window."
after 1000;# Allow humans to look at the window.
# Hide the red window.
puts "Hiding the window"
wm attributes .a -hidden 1
update idletasks
puts "Reconfiguring the window."
# Turn it blue.
.a configure -bg blue
# Resize it
wm geometry .a 250x300
after 1000;# Allow humans to look at the window.
# Reveal it.
puts "Revealing the window."
wm attributes .a -hidden 0
update idletasks
puts "The window should now have turned blue and changed size."
after 1000; # Allow humans to look at the window.
destroy .