Files
Phoenix/docs/sphinx/rest_substitutions/snippets/python/converted/FileDialog.2.py
Andrea Gavana 14c7c36924 Phoenix:
- Latest Phoenix development integrated in the documentation builder;
- Added the latest `BitmapComboBox`, `RichToolTip` etc..., with their sample;
- Adapted the existing `adv` samples to use `wx.adv` in the code;
- Fixed wrong rendering of various snippets.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@71692 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-06-07 21:07:40 +00:00

18 lines
754 B
Python

def OnSaveAs(self, event):
saveFileDialog = wx.FileDialog(self, "Save XYZ file", "", "",
"XYZ files (*.xyz)|*.xyz", wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT)
if saveFileDialog.ShowModal() == wx.ID_CANCEL:
return # the user changed idea...
# save the current contents in the file
# this can be done with e.g. wxPython output streams:
output_stream = wx.FileOutputStream(saveFileDialog.GetPath())
if not output_stream.IsOk():
wx.LogError("Cannot save current contents in file '%s'."%saveFileDialog.GetPath())
return