Righto... I found some stuff, but not exactly what I was after
From the Documentation...
BrowseForFolder( OPTIONS )
Displays the standard ``Browse For Folder'' dialog box. Returns the selected item's name, or undef if no item was selected or an error occurred.
Note that BrowseForFolder must be called as a standalone function, not as a method.
Example:
$folder = Win32::GUI::BrowseForFolder(
-root => "C:\\Program Files",
-includefiles => 1,
);
other options are...
-computeronly, -domainonly, -driveonly, -editbox, -folderonly, -includefiles, -owner, -printeronly, -root, -title
What I was actually thinking of was $ret = GUI::GetSaveFileName(
-title => "Save your newly generated Mail Merge Document.",
-file => "\0" . " " x 256,
-filter => [
"Word documents (*.doc)" => "*.doc",
"All files", "*.*",
],
With another option in there, but I can't find it anywhere. Oh well, I am sure that browse for folder will work.
Let me know how you get on.
Regards, Gerard.
| [reply] [d/l] [select] |
That's strange, last time I wanted to do this I had to use Win32::FileOp from Jan Krynicky. Maybe it was added to Win32::GUI in a recent version or I just overlooked the docs before.
It's not bad though, Win32::FileOp has some other nice functions for deleting\recyclying files etc. Worth a look.
update: Oh, you can use Win32::FileOp::BrowseForFolder() in a console script and avoid the overhead of loading Win32::GUI.
Simon Flack ($code or die)
$,=reverse'"ro_';s,$,\$,;s,$,lc ref sub{},e;$,
=~y'_"' ';eval"die";print $_,lc substr$@,0,3;
| [reply] |
YES, Win32::GUI::BrowseForFolder is perfect! That is the widget I am looking for...
Thank you Gerard! It was really nice of you to help me out with this widget. I often find when I am learning a new set of GUI widgets/methods, I know that a certain call to a widget exists (because I've seen the widget!), but I have trouble finding the actual name of the method...
I owe you one!
Mr. Don't
| [reply] |
I assume that what you want is an open file dialog box that selects an entire directory instead of just a file?
I have done this before though, but it slips my memory how exactly to do it. I do not have the documentation, nor the program handy at the moment. If this is what you are after then let me know and I will look it up when I get home. Don't go reinventing any wheels now though, as I have tried this sort of thing before too, with win32::gui and although it worked it proved to be much more trouble than it was worth.
Regards,
Gerard. | [reply] |
Yes Gerard,
That is exactly what I was hoping to do...
I also feel like I've seen an example of this somewhere, but i have been searching the Internet all day and can't quite seem to pin down where it was.
Thanks for your help!
Mr. Don't
| [reply] |
I'll be able to give you the answer in ~ 2-3 hours.
| [reply] |
You should also try the Win32::GUI Mailing List. It tends to be fairly well trafficed and you can get most of your specific Win32::GUI questions answered pretty quickly.
Don't have the address handy though (just unsubscribed after realising I hadn't read or sent a message to the list in 3-4 months) check the POD. | [reply] |