Tkinter: Making a window disappear

Eric Brunel eric_brunel at
Tue Oct 10 10:42:16 CEST 2006

On Mon, 09 Oct 2006 11:08:39 +0200, Claus Tondering  
<claus.tondering at> wrote:

> I just solved the problem myself:
> I wrote:
>>             self.destroy()
> Writing "self.master.destroy()" instead does the trick.

As an alternative (which is better IMHO), you may consider specializing  
Toplevel instead of Frame for your dialog:

class MyDialog(Toplevel):

In tk/Tkinter, a Frame is a generic container for widgets; it is not what  
is usually called a window. Creating an instance of Frame when there is no  
window to contain it happens to create a new one, but it is a side-effect,  
and you should not rely on it.

Once you've done that, you can simply write:


to delete the window.

> Sorry for the inconvenience.

No problem.

python -c "print ''.join([chr(154 - ord(c)) for c in  

More information about the Python-list mailing list