On Tue, 29 Mar 2005 10:37:10 GMT, max(01)* <[EMAIL PROTECTED]> wrote:
hi people.

when i create a widget, such as a toplevel window, and then i destroy
it, how can i test that it has been destroyed? the problem is that even
after it has been destroyed, the instance still exists and has a tkinter
name, so testing for None is not feasible:

 >>> import Tkinter
 >>> fin = None
 >>> fin1 = Tkinter.Toplevel()
 >>> fin1.destroy()
 >>> print fin1
.1075951116

The winfo_exists method is what you want:

print fin1.winfo_exists()
0

However, I'm curious about *why* you want to do that: since *you* made the call 
to destroy, what would you want to do anything with a widget you've already 
destroyed?

HTH
--
python -c 'print "".join([chr(154 - ord(c)) for c in 
"U(17zX(%,5.z^5(17l8(%,5.Z*(93-965$l7+-"])'
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to