Danny Shevitz wrote:
Glad to see you back and glad to hear your feeling better.
I tried IsBeingDeleted() and it just didn't work. I put it in both the OnEndEdit handler and in the setNodeText. Neither made
a difference. The error is the same. It is as if the TreeCtrl is not being deleted, it is already deleted, which is what the error
message is saying. Is there a way to tell if there is no longer a cpp object attached to a python object. More along the lines
of IsDeleted? I poked around but didn't find anything.
When a widget is destroyed the Python class of the proxy object is dynamically changed to a class that simply raises an exception if an attribute access is attempted, which you have seen. This class also has a __nonzero__ method which will allow you to just test the widget with an if statement to see if it is still valid, like this:
if widget:
# do something with widget
ยทยทยท
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!