herby1620 has asked for the wisdom of the Perl Monks concerning the following question:

I'm using PerlTk (on a Windows [yuck!] platform). Mostly is is very nice and the nice gui's are all wonderful. At times I want to get a file, and the routine 'getOpenFile' or 'getSaveFile' works quite well. The problem now is that I desire to obtain a directory name where I'll get some files, and put some more (pre-defined names). The problem is that there is no 'getDirectory' (or its equivalent, whatever the name) in PerlTk. I may have run across this before, but as I didn't need it at the time (I do now!) I didn't bookmark it. Hints are most welcome.

My current solution is to ask for a file in the directory, but that is a bit tedious as the only one I can properly ask for is a few levels down from where I want to be.

Replies are listed 'Best First'.
Re: getDirectory?? (PerlTk)
by mifflin (Curate) on Apr 06, 2007 at 23:57 UTC
    how about chooseDirectory ?
      I knew there was something.
      Now for the "bad news":
      I'm stuck with perl 5.6.x
      While it is documented over at CPAN (thanks!). There is no mention of it in _Mastering PerlTk_ (why I asked!).
      Thanks for the answer. I may need to "roll my own" or some such. Maybe I can lift the code from PerlTk 804.
Re: getDirectory?? (PerlTk)
by zentara (Cardinal) on Apr 07, 2007 at 10:21 UTC
    You might like Tk::CanvasDirTree. It's only minimally tested on windows, but feel free to modify it. I originally wrote it to emulate Gtk2's Tree widegt, and gave it a floating background image.

    I'm not really a human, but I play one on earth. Cogito ergo sum a bum