NAME

Tk::FilePicker - Tk::FileBrowser based file dialog

SYNOPSIS

require Tk::FilePicker;
my $p = $window->FilePicker(@options);
my @files = $p->pick;

DESCRIPTION

CONFIG VARIABLES

Switch: -checkoverwrite

Only works when the '-selectmode' option is set to single. Checks if the selected file exists and prompts and overwrite dialog.

Switch: -selectstring

Text string for the 'Ok' button.

ADVERTISED SUBWIDGETS

Browser
Entry

METHODS

All the pick methods can be called with these options:

-initialdir

Directory to load on pop.

-initialfile

Suggested file name.

The pick methods always return their results in list context. So even when you expect only one result you have to do:

my ($file) = $fp->pickWhatEver(%options);
pick(%options)

The basic pick method. Besides the two options above you can give it many of the options of Tk::FilePicker and Tk::FileBrowser.

pickFileOpen(%options)

Calls pick configured to select one file for opening. Equivalent to:

my ($file) = $window->pick(
   -checkoverwrite => 0,
   -showfolders => 1,
   -showfiles => 1,
   -selectmode => 'single',
   -selectstring => 'Open',
   -title => 'Open file',
);
pickFileOpenMulti(%options)

Calls pick configured to select multiple files for opening. Equivalent to:

my @files = $window->pick(
   -checkoverwrite => 0,
   -showfolders => 1,
   -showfiles => 1,
   -selectmode => 'extended',
   -selectstring => 'Open',
   -title => 'Open file',
);
pickFileSave(%options)

Calls pick configured to select one file for saving. Pops a dialog for overwrite if the selected file exists. Equivalent to:

my ($file) = $window->pick(
   -checkoverwrite => 1,
   -showfolders => 1,
   -showfiles => 1,
   -selectmode => 'single',
   -selectstring => 'Save',
   -title => 'Save file',
);
pickFolderSelect(%options)

Calls pick configured to select one folder. Equivalent to:

my ($folder) = $window->pick(
   -checkoverwrite => 0,
   -showfolders => 1,
   -showfiles => 0,
   -selectmode => 'single',
   -selectstring => 'Select',
   -title => 'Select folder',
);

LICENSE

Same as Perl.

AUTHOR

Hans Jeuken (hanje at cpan dot org)

TODO

BUGS AND CAVEATS

SEE ALSO