Tkinter wm_withdraw doesn't work

Theodore D. Sternberg strnbrg at c532352-a.frmt1.sfba.home.com
Sat May 19 17:08:39 EDT 2001


Anyone know the correct way to translate the Tk-ism "wm withdraw ."
to Python/Tkinter?

As far as I can see, the implementation of the Wm class' wm_withdraw
function tries to call a nonexistent member function called "tk()":

I executed the following file:

--------- file withdraw.py ------
from Tkinter import *

root = Tk() 

wm = Wm()
wm.wm_withdraw()

root.mainloop()
---------------------------------

...and obtained the following result:

$ python withdraw.py
Traceback (most recent call last):
  File "withdraw.py", line 7, in ?
    wm.wm_withdraw()
  File "/usr/local/lib/python2.1/lib-tk/Tkinter.py", line 1457, in wm_withdraw
    return self.tk.call('wm', 'withdraw', self._w)
AttributeError: Wm instance has no attribute 'tk'










More information about the Python-list mailing list