Files
Phoenix/docs/sphinx/rest_substitutions/snippets/python/converted/CloseEvent.1.py
2012-04-10 03:16:37 +00:00

16 lines
616 B
Python

def OnClose(self, event):
if event.CanVeto() and self.fileNotSaved:
if wx.MessageBox("The file has not been saved... continue closing?",
"Please confirm",
wx.ICON_QUESTION | wx.YES_NO) != wx.YES:
event.Veto()
return
self.Destroy() # you may also do: event.Skip()
# since the default event handler does call Destroy(), too