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 a control

Status
Not open for further replies.

Cadao

Programmer
Jul 22, 2005
1
BR
Is there a way to hide a control like a button?
 
Yes, you can use the option forget with the geometry manager (pack, place or grid) you used to show your widget.
Code:
button .b -text test
pack .b
after 1000 pack forget .b
You will watch the button disappear after 1 s.

To show the widget again, re-use the same geometry manager you used.
In this case
Code:
pack
retains all the configuration so you only need:
Code:
pack .b
to get the button as it was.
On my win2k box with Tk 8.3 this is not the case with
Code:
place
(you need to give again the configuration).

Good luck

ulis
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top