Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^4: Directory and file selection with PERL/Tk

by elef (Friar)
on Jun 13, 2013 at 12:02 UTC ( #1038728=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Directory and file selection with PERL/Tk
in thread Directory and file selection with PERL/Tk

No, I'm still using this ugly and clumsy widget... I don't think there's an easily available better option.
As far as creating a new subdirectory, the chooseDirectory returns a path, you create the directory. Parts of my code look something like this:

my $folder; # in real code this is triggered by a button press $folder = $mw->chooseDirectory( -initialdir => '~', -title => 'Choo +se a folder',); # triggered after user made its folder choice # almost certainly won't work if user enters a multi-level folder stru +cture if (!-d "$folder") { print "\nCreating $folder"; mkdir "$folder" or abort("Can't create folder $folder: $! at line +" . __LINE__); # abort sub is my own code, use die if needed }


Comment on Re^4: Directory and file selection with PERL/Tk
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1038728]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (17)
As of 2015-07-06 20:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (83 votes), past polls