1

I have a Perl script that uses Tkx::tk___chooseDirectory() to allow the user to select a directory.

The problem is only a few specific directories are valid for the actions that the script is going to perform. Is there a way to limit the folders displayed by this function to show only folders below a specific subdirectory?


Example:

Directory listing

Say I wanted to only give the user the option to select "Perl64" or any of its subdirectories. How can I force it to hide the other folders (like "PerfLogs" or "Program Files") and only display the valid folders.

I know I can use the -initialdir option to make it start on "Perl64", but that doesn't hide the other choices.

tjwrona1992
  • 8,614
  • 8
  • 35
  • 98
  • 1
    It seems like there is no options to ignore certain folders.. so either you make a custom dialog (build the gui from scratch), or let the user select the folder using `chooseDirectory` and validate the user input later.. – Håkon Hægland Jun 02 '15 at 21:01
  • I currently have it set up to validate the input but it just feels so clunky to have all those extra folders... Obviously building the whole thing from scratch would be extreme overkill and would take a very long time so unless someone finds some magic way to do this I guess I'll have to settle with what I have... – tjwrona1992 Jun 03 '15 at 15:16

0 Answers0