wxPython equivalent to Tkinter's protocol attribute?
When you click on the close button you are producing an EVT_CLOSE
event so if you bind this event to an onClose
method then you can execute whatever you want before actually closing the application. A simple example:
class ChildFrame(wx.Frame): def __init__(self): wx.Frame.__init__(self, None) self.Bind(wx.EVT_CLOSE, self.on_close) def on_close(self, evt): process_whatever_you_want() self.Destroy()