For Programmers: Free Programming Magazines  


Home > Archive > Tcl > May 2004 > Hidding a frame...









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Hidding a frame...
Jerry

2004-05-24, 10:40 am

Hello,

I have a simple Picture Viewer that has a frame for thumbnails next to
a larger frame for
displaying fullsized (or scaled) images. Both frames are sitting on
top of a "button bar".

I have a slide show button that will step through all of the images.
While the slide show
is playing I would like to "hide" the thumbnail frame and have the
viewing frame fill in
the space where the thumbnail frame was located. Clicking the stop
slideshow button
should restore the hidden thumbnail frame.

My first experiments have not been too fruitful.

Setting the width of the thumbnail frame to either 0 or 1 still leaves
about 40-50 pixels
of the frame showing. Is there a minimun width for widgets?

When the thumbnail frame is shrunk, the "viewer" frame does not fill
in the vacated
space, the whole window is shrunk...

Is there some slick way to do what I want?

--Jerry
Jeff Godfrey

2004-05-24, 11:44 am


"Jerry" <jerry.levan@eku.edu> wrote in message
news:46850fd1.0405240555.12a69a2f@posting.google.com...
: Hello,
:
: I have a simple Picture Viewer that has a frame for thumbnails next to
: a larger frame for
: displaying fullsized (or scaled) images. Both frames are sitting on
: top of a "button bar".
:
: I have a slide show button that will step through all of the images.
: While the slide show
: is playing I would like to "hide" the thumbnail frame and have the
: viewing frame fill in
: the space where the thumbnail frame was located. Clicking the stop
: slideshow button
: should restore the hidden thumbnail frame.
:
: My first experiments have not been too fruitful.
:
: Setting the width of the thumbnail frame to either 0 or 1 still leaves
: about 40-50 pixels
: of the frame showing. Is there a minimun width for widgets?
:
: When the thumbnail frame is shrunk, the "viewer" frame does not fill
: in the vacated
: space, the whole window is shrunk...
:
: Is there some slick way to do what I want?

Jerry,

Assuming you are using either the "pack" or "grid" geometry manager, you
probably want to check out the "forget" subcommand ("pack forget" and "grid
forget"). Basically, they will allow you to "unmap" (remove from the
screen) any widget that you specify - in this case your frame.

So, when you want the frame to disappear, you just "forget" it, and when you
want it to reappear, you pack or grid it back to the proper location.

Ultimately, it should be very easy to get the results you are after.

Jeff


Ralf Fassel

2004-05-24, 1:33 pm

* jerry.levan@eku.edu (Jerry)
| When the thumbnail frame is shrunk, the "viewer" frame does not fill
| in the vacated space, the whole window is shrunk...

Check the `propagate' subcommand of `pack' or `grid'.

label .thumb -text thumbnail -bg yellow
label .slideshow -text slideshow -bg green
button .stop -text stop -command stop
button .start -text start -command start

pack propagate . false

pack .thumb .start .stop -fill x
pack .slideshow -fill both -expand yes -after .thumb

proc start {} {
pack forget .thumb
}

proc stop {} {
pack .thumb -before .slideshow -fill x
}

HTH
R'
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com