I want to make a frame that can be hidden and shown alternatively. The problem is Tk does not provide any hide/unpack command. I use vtcl and there is an option "Window hode" which only hides the window at top level. Now I want to hide a frame and later show the same frame again. It can be thought of as unpacking one frame and showing the other. My code can 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 previously filled and value of $i
is toggled hence $top.frame1
and $top.frame2
are shown alternatively when this proc is called. All, I want to know is that does there exists and command like unpack
which can help me do this? By the way, unpack
here is just an idea.