How do I get my filechooser to be able to select both files and folders when the open button on the filechooser dialog is hit ? I want to squeeze the ability to open files and filders in just one filechooser. I am using GTK+ and Python.
Asked
Active
Viewed 1,451 times
7
-
When you clicked on a folder, how would the program know whether to close the dialog and return it, or look inside it? – ptomato Dec 07 '10 at 18:25
-
I decided to create two filechoosers, one for file and the other for folder selection to side step the problem. – thotheolh Dec 17 '10 at 11:20
-
3This is not possible as explained here: http://stackoverflow.com/questions/3170962/enable-gtkfilechooserdialog-to-select-files-or-folders – Geoffrey Jan 10 '11 at 12:28
1 Answers
2
I was thinking about this, and although in your comments you've decided to go another route, I do have a suggestion: Write your own file chooser subclass of the GTK+ one and provide two "Open" buttons, one to "Open File" and another to "Open Directory". That would eliminate the ambiguity discussed above.

Ken Kinder
- 12,654
- 6
- 50
- 70