Phoenix - MSWComboTreeBox

I get the following exception on above.

File "d:\devMine\twcbv5\twcbsrc\controllers\app_cb.py", line 1277, in <module>
   app.MainLoop()
File "c:\Python34\Lib\site-packages\wx\core.py", line 1893, in MainLoop
   rv = wx.PyApp.MainLoop(self)
File "c:\Python34\Lib\site-packages\wx\lib\combotreebox.py", line 821, in OnSelectionChangedInTree
   if self.IsBeingDeleted():

builtins.RuntimeError: wrapped C/C++ object of type MSWComboTreeBox has been deleted

Tried to change:
   if self.IsBeingDeleted():

to:
   if self:

or:
   if self._tree:

but still the same error

Is there something to be changed in MSWComboTreeBox to be able to catch that it has been deleted?

Werner

Werner wrote:

I get the following exception on above.

File "d:\devMine\twcbv5\twcbsrc\controllers\app_cb.py", line 1277, in
<module>
app.MainLoop()
File "c:\Python34\Lib\site-packages\wx\core.py", line 1893, in MainLoop
rv = wx.PyApp.MainLoop(self)
File "c:\Python34\Lib\site-packages\wx\lib\combotreebox.py", line 821,
in OnSelectionChangedInTree
if self.IsBeingDeleted():

builtins.RuntimeError: wrapped C/C++ object of type MSWComboTreeBox has
been deleted

Tried to change:
if self.IsBeingDeleted():

to:
if self:

You'll need to reverse that to "if not self:" since you want to bail out of the event handler if the widget doesn't exist.

···

--
Robin Dunn
Software Craftsman

Werner wrote:

...

Tried to change:
if self.IsBeingDeleted():

to:
if self:

You'll need to reverse that to "if not self:" since you want to bail out of the event handler if the widget doesn't exist.

Hhm, must have had not enough coffee:-[ , did a PR for it.

Thanks
Werner

···

On 2/5/2015 3:41, Robin Dunn wrote: