Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hiding widgets 2

Status
Not open for further replies.

DrA10101

Programmer
Jun 10, 2003
8
US
I am new to tcl, any help is appreciated. I have a tcl/tk GUI application on a small resource Linux device which does not have a Window Manager. I would like to display different widgets on the screen based on the state of the device. When state 1 widgets are displayed, state 2 widgets should not be visible, ...

Thanks in advance,

Craig
wcarm@hotmail.com
 
This is probably neither the most efficient nor elegant but here's what I would do:

1. define a frame for each state and build a proc to populate its widgets.
2. in each frame/state's proc, destroy all the others.
That is, lets say there are 3 states -> 3 frames: .1, .2, .3.
Then, have a proc to build the display for state 1:

proc state1 {} {
destroy .2 .3
pack [frame .1 -borderwidth......]
label .1. .....
entry .1. ....
etc
}

3. however you check the state of the device, have the result call the right proc.

any help?


Bob Rashkin
rrashkin@csc.com
 
Thank You Bob,

I was hoping for something like put all of the widgets for a state on a canvas or a frame, overlay the frames, and make one invisible. However, I don't see a way to do that.

Thanks again for the suggestion,

- Craig
wcarm@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top