I have a Python WxWidgets program, and have a "File->Quit" menu option that calls a quit function that cleanly shuts down my application. However, the application can also be closed by pressing the 'X' in the top right of the window. I would like to add a hook to capture that window close event to do my clean shutdown. How do I do that?
My main window is created with these options:
wx.Frame.__init__(self, parent, title=title, style=wx.DEFAULT_FRAME_STYLE ^ wx.RESIZE_BORDER)
ummm
def __init__(self,parent,title,...):
wx.Frame.__init__(self, parent, title=title, style=wx.DEFAULT_FRAME_STYLE ^ wx.RESIZE_BORDER)
self.Bind(wx.EVT_CLOSE,self.OnClose)
def OnClose(self,evt):
print "CLOSE!!!"
self.Destroy()