I have a panel with auitoolbar in it and a 'delete' button on the toolbar. Pressing this button will delete the panel and everything in it. The problem is that beside wx.EVT_TOOL which I use to trigger the deletion, auitoolbar also triggers OnLeftUp event which happens after the panel was deleted, thus the PyDeadObjectError.
Is there any way around this?
Regular button works just fine, it's just a problem with auitoolbar.
python 2.7.2
wxpython 2.8.12
Is
OnLeftUpbound withwx.EVT_LEFT_UPevent? If so, then on panel deletion you need also to explicitly unbind your panel with the event: