I've got a little problem here, and i want to hear your opinions about it:
I've got a little Tk-Application, and i want to select a directory in it.
The script shall run on other computers in my company as well, so i do not want to install further modules.
BTW: The System is Windows XP an IndigoPerl 5.6
Unfortunately Tk::FileSelect doesn't return directories, and i can't find Tk::chooseDirectory on my machine, which was recommended by some monks in the chatterbox.
So after some scrolling through the docs, i found Tk::DirTree, which looked very promising, but i cannot get the currently selected directory out of this widget, at least not in the following way:
I found the following documentation:my $currentDir = "D:/p/"; my $dirTreeFrame = $mainwin->Frame; $dirTreeFrame->pack(); my $scrolledDirTree = $dirTreeFrame->Scrolled('DirTree', -scrollbars = +> "oeos")->pack(); $scrolledDirTree->configure(-directory => $currentDir, -width => 35, -height => 35, -command=> sub {doCreate($currentDir)} +);
So what argument do i have to submit, and how do i get it? It's not -directory, or else the code above should work...
Thanks for your help
Elderian
Update:
I used one single line out of zentara's code, and it worked! Hooray....
Unfortunately i have to offer more than one drive, which is not easy in windows.
So i found Win32::GUI::BrowseForFolder, which seems to be just thing i always searched for! ;)
Thank you all for your help!
In reply to How do i select a directory in Tk? by Elderian
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |