I want to create a frame that can be hidden and shown as an alternative. The problem is that Tk does not provide the hide / unpack command. I use vtcl, and there is a "Window hode" option that only hides the window at the top level. Now I want to hide the frame, and then show the same frame again. It can be considered as unpacking one frame and displaying another. My code might be like this:
proc show1hide2 { } { global i top if {$i == 1} { unpack $top.frame1 pack $top.frame2 set i 0 } else { unpack $top.frame2 pack $top.frame1 set i 1 } }
In this procedure, $top.frame1
and $top.frame2
were pre-populated and the value of $i
switched, so $top.frame1
and $top.frame2
are shown alternatively when calling this proc. That's it, I want to know that there exists and exists a command like unpack
that can help me do this? By the way, unpack
is just an idea.
source share