Files
Phoenix/docs/sphinx/rest_substitutions/snippets/python/converted/wx.CloseEvent.1.py
Metallicow 1257f42189 ⁉️ Trim trailing whitespace docs/sphinx/rest_substitutions/*.py
⁉️ Not sure if the generated .rst stuff is intended to have
whitespace like this in it or not, so seperating this from the other
commits, so easy to revert if necessary.
2018-01-16 09:02:20 -06:00

16 lines
548 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