I'm working on an application that will need to use a variety of Dialogs. I'm having trouble getting events bound in a way that ensures that my Dialogs are destroyed properly if someone closes the application before dismissing the dialogs. I would expect to use something like this:
class Form(wx.Dialog):
def __init__(self):
wx.Dialog.__init__(None, -1, "Dialog")
self.Bind(wx.EVT_CLOSE, self.onClose)
self.Bind(wx.EVT_CLOSE, self.onClose, MAIN_WINDOW)
...
def onClose(self, evt):
self.Destroy()
The behavior I'm currently encountering is that if someone opens a Dialog, then closes the Application before dismissing the Dialog the Application does not exit fully. MAIN_WINDOW is a reference to the Frame that's registered as my Top Level Window. Thanks in advance!