mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-07 20:40:11 +01:00
fixing code snippet - open even if contentNotSaved
This commit is contained in:
@@ -7,21 +7,21 @@
|
||||
wx.ICON_QUESTION | wx.YES_NO, self) == wx.NO:
|
||||
return
|
||||
|
||||
# else: proceed asking to the user the new file to open
|
||||
# else: proceed asking to the user the new file to open
|
||||
|
||||
openFileDialog = wx.FileDialog(self, "Open XYZ file", "", "",
|
||||
"XYZ files (*.xyz)|*.xyz", wx.FD_OPEN | wx.FD_FILE_MUST_EXIST)
|
||||
|
||||
if openFileDialog.ShowModal() == wx.ID_CANCEL:
|
||||
return # the user changed idea...
|
||||
|
||||
openFileDialog = wx.FileDialog(self, "Open XYZ file", "", "",
|
||||
"XYZ files (*.xyz)|*.xyz", wx.FD_OPEN | wx.FD_FILE_MUST_EXIST)
|
||||
|
||||
if openFileDialog.ShowModal() == wx.ID_CANCEL:
|
||||
return # the user changed idea...
|
||||
|
||||
# proceed loading the file chosen by the user
|
||||
# this can be done with e.g. wxPython input streams:
|
||||
input_stream = wx.FileInputStream(openFileDialog.GetPath())
|
||||
|
||||
if not input_stream.IsOk():
|
||||
|
||||
wx.LogError("Cannot open file '%s'."%openFileDialog.GetPath())
|
||||
return
|
||||
|
||||
|
||||
# proceed loading the file chosen by the user
|
||||
# this can be done with e.g. wxPython input streams:
|
||||
input_stream = wx.FileInputStream(openFileDialog.GetPath())
|
||||
|
||||
if not input_stream.IsOk():
|
||||
|
||||
wx.LogError("Cannot open file '%s'."%openFileDialog.GetPath())
|
||||
return
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user