after, after_cancel and Python 2.3

Michael Peuser mpeuser at web.de
Fri Aug 29 15:07:38 EDT 2003


"Edward K. Ream" <edreamleo at charter.net> schrieb im Newsbeitrag
news:vkur12pg3gj5ac at corp.supernews.com...
> > Previous to Python 2.3 my app has destroyed the root Tk window using
> > root.destroy rather than the more usual root.quit. In Python 2.3 this
does
> > not work so well...

Your example is somewhat complicated to say the least. As I am not using
2.3/8.4 at the moment I have not encountered like problems. But note that
there are fundamental differences between Tk.quit and Tk.destroy. Tk.quit
just leaves the event loop and touches no widget. See this example:

  from Tkinter import *
  m=Tk()
  Button(m,text="quit",command=m.quit).pack()
  mainloop()
  print "this is not The End"
  mainloop()

Maybe destroy did not trigger Python garbage collection in 8.3 as expected,
so data could have been erronously accessable. The memory leak would not
have been to obvious because destroy is a rare instruction...

May also be there is some bug with destroy in Tk 8,4 ;-)

Kindly
Michael P
>






More information about the Python-list mailing list