making widgets invisible

richard_chamberlain at my-deja.com richard_chamberlain at my-deja.com
Mon Jul 3 09:44:19 EDT 2000


Hi Thomas,

I'm sure there's a nicer way to do it (I'll ponder on it), but...

from Tkinter import *
root=Tk()
def hideMe():
    myButton.configure(text="",relief=FLAT)
myButton=Button(root,text="Hide Me!",command=hideMe)
myButton.pack()
root.mainloop()

You could pass the widget reference to the method so it would be
universal - bit of pain to reverse though!

Richard



In article <3960794E.6E2B36E6 at muc.das-werk.de>,
  thiele at muc.das-werk.de wrote:
> How can I realize that a set of widgets (buttons and entries)
> is invisible when I don't need them and visible when I need them?
>
> One solution is to create a dialog window (or frame) and destroy it
> then.
> But is there a better one?
>
> Withdrawn works only with top level widgets.
>
> Thanks Thomas
>


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list