[wxpython] exclude files in a wx.FileDialog?

J

John Field

Hello,

Is it possible to exclude certain files in a wx.FileDialog, so that the user
won't see them and can't select them with the mouse in de File open window?

I was thinking of somehow extending the class FileDialog(Dialog)
in the wx module _windows.py to a subclass, but I'm not sure how to do that
(if feasible).


cheers
 
F

Franz Steinhaeusler

Hello,

Is it possible to exclude certain files in a wx.FileDialog, so that the user
won't see them and can't select them with the mouse in de File open window?

I was thinking of somehow extending the class FileDialog(Dialog)
in the wx module _windows.py to a subclass, but I'm not sure how to do that
(if feasible).


cheers

wx.FileDialog is only a wrapper for the api FileDialog (at least this
applies for windows) and therefore it is not possible to derive from it.

Really exclude, I think, is not possible.

You can put a mask
wx.FileDialog(...wildcard = "BMP files (*.bmp)|*.bmp|GIF files
(*.gif)|*.gif")

Otherwise you have to create your own FileDialog.
 
J

John Field

Hello Franz,

wx.FileDialog is only a wrapper for the api FileDialog (at least this
applies for windows) and therefore it is not possible to derive from it.
Really exclude, I think, is not possible.
You can put a mask
wx.FileDialog(...wildcard = "BMP files (*.bmp)|*.bmp|GIF files
(*.gif)|*.gif")

In my experience this one shows only .bmp files, whereas
wildcard = "Image files | *.bmp;*.gif"
shows both extensions. Which i find strange, considering wxpython Help voor
wxFileDialog:

It must be noted that wildcard support in the native Motif file dialog is
quite limited: only one alternative is supported, and it is
displayed without the descriptive test; "BMP files (*.bmp)|*.bmp'' is
displayed as "*.bmp'', and both "BMP files (*.bmp)|*.bmp|GIF files
(*.gif)|*.gif'' and "Image files|*.bmp;*.gif'' are errors.

Unfortunately there is no expected extension for the input, most probably the
input files will have no extension at all, but it really is up to the user.

Otherwise you have to create your own FileDialog.
Yes, ehh, pff

Thanks for responding

cheers
 
F

Franz Steinhaeusler

Hello John,
Unfortunately there is no expected extension for the input, most probably the
input files will have no extension at all, but it really is up to the user.


Yes, ehh, pff

Thanks for responding

you're welcome.
sorry, that i don't have any other infos for you anymore.

I would ask in the wxpython-user mailing list or
wxwidget Ng.

You can also take a look to DrPython;
There is a File drFileDialog, which is a
full FileDialog based on a wx.ListCtrl.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top