just a quick check before i get started

Before I waste my time, I thought I'd ask. Can I use the wx.OPEN style of the FileDialog class for creating new files as well as for opening existing ones? Or does wx.OPEN carry with it certain features that aren't appropriate for creating new files?

Thanks.

Hi John,

Before I waste my time, I thought I'd ask. Can I use the wx.OPEN style
of the FileDialog class for creating new files as well as for opening
existing ones? Or does wx.OPEN carry with it certain features that
aren't appropriate for creating new files?

IIRC, the default behavior is that the user *can* create new files.
You can somewhat veto this user action by adding:

wx.FD_FILE_MUST_EXIST

To the style list. Ah, another thing: it seems that now wx.OPEN =>
wx.FD_OPEN. Obviously wx.OPEN will work also with 2.7 to guarantee
back-compatibility, but it might be removed in the future.

Andrea.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.virgilio.it/infinity77/

Andrea Gavana wrote:

IIRC, the default behavior is that the user *can* create new files.
You can somewhat veto this user action by adding:

wx.FD_FILE_MUST_EXIST

To the style list. Ah, another thing: it seems that now wx.OPEN =>
wx.FD_OPEN. Obviously wx.OPEN will work also with 2.7 to guarantee
back-compatibility, but it might be removed in the future.

Thanks!

John Salerno wrote:

Before I waste my time, I thought I'd ask. Can I use the wx.OPEN style of the FileDialog class for creating new files as well as for opening existing ones? Or does wx.OPEN carry with it certain features that aren't appropriate for creating new files?

Thanks.

Well, after a quick check it doesn't seem like this will work on its own. However, it looks like the user can still type a name and then when wx.ID_OK is returned, I can handle the creation of the file myself. But two problems:

1. The button says "Open" since it is an Open dialog.
2. If the user selects an existing file, I guess I'd have to do some extra checking so I don't try to create that file anew.