Entry
how to hide a widget (Button) in container?
Sep 8th, 2003 14:28
Daniel Haertle, bin zhang, http://www.pythonware.com/library/tkinter/introduction/
from Tkinter import *
container = Tk()
Label(container, text="Hello, world!").pack()
def disappear(*args):
button.pack_forget()
button = Button(container, text="Press me to disappear", command=disappear)
button.pack()
container.mainloop()
Description:
Hiding is done by the pack_forget method. For the other geometry
managers the respective command is place_forget and grid_forget.
The widget you want to hide must be named, e.g. you cannot hide the
label in the example above.
You can redisplay the widget by repacking it.