Search code examples
c++linuxfiledialogwxwidgets

How to limit file choice to a single directory?


I am working with wxWidgets 2.9.3 in Arch Linux on a C++ project where the finished program will run in a "kiosk mode", so the user should not be able to access or even see the underlying system files. I still need to let the user open and save files on USB drives that he might connect. I have set it up so that USB drives are automatically mounted on /media.

So what I need is a file-picking dialog where I can limit the choice to files and folders in the /media directory. Does such a thing exist, or do I have to make one?


Solution

  • wxFileDialog does not have that feature. If I were you I would build a simple dialog like this:

    custom file dialog