The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.
=pod

=head1 NAME

FLTK::file_chooser - File chooser widget for the Fast Light Tool Kit

=head1 Description



=head1 Functions

=head2 C<dir_chooser>
X<dir_chooser>

=over

=item C<my $directory = FLTK::dir_chooser( $message, $directory, $relative );>X<my_directory_FLTK_dir_chooser_message_directory_relative_>

Show a file chooser dialog and pick a directory.

Expected parameters include the C<$message> in the titlebar, the initially
selected C<$directory>, and a boolean value which decides whether the returned
value is relative (true) or absolute (false).

Import this function with the C<:dialog> or C<:default> tags.

=for hackers xs/file_chooser.xs line 55

=back

=head2 C<file_chooser>
X<file_chooser>

=over

=item C<my $file = FLTK::file_chooser( $message, $pattern, $filename, $relative );>X<my_file_FLTK_file_chooser_message_pattern_filename_relative_>

Pops up the file chooser, waits for the user to pick a file or Cancel, and
then returns that filename or undef if Cancel is chosen.

C<$message> is a string used to title the window.

C<$pattern> is used to limit the files listed in a directory to those matching
the pattern. This matching is done by C<filename_match( )>. Use undef to show
all files.

C<$filename> is a default folder/filename to fill in the chooser with. If this
ends with a '/' then this is a default folder and no file is preselected.

If C<$filename> is undef, then the last filename that was choosen is used,
unless the C<$pattern> changes, in which case only the last directory is used.
The first time the file chooser is called this defaults to a blank string.

The returned value points at a static buffer that is only good until the next
time the L<C<file_chooser( )>|FLTK::file_chooser/"dialog"> is called.

Import this function with the C<:dialog> or C<:default> tags.

=for hackers xs/file_chooser.xs line 63

=back

=head2 C<file_chooser_callback>
X<file_chooser_callback>

=over

=item C<FLTK::file_chooser_callback( \&coderef );>X<FLTK_file_chooser_callback_coderef_>

This function is called every time the user navigates to a new file or
directory in the file chooser. It can be used to preview the result in the
main window.

=pod 

Import this function with the C<:dialog> tag.

=for hackers xs/file_chooser.xs line 113

=back

=head1 Author

Sanko Robinson <sanko@cpan.org> - http://sankorobinson.com/

=head1 License and Legal

Copyright (C) 2008-2010 by Sanko Robinson <sanko@cpan.org>

This program is free software; you can redistribute it and/or modify it under
the terms of
L<The Artistic License 2.0|http://www.perlfoundation.org/artistic_license_2_0>.
See the F<LICENSE> file included with this distribution or
L<notes on the Artistic License 2.0|http://www.perlfoundation.org/artistic_2_0_notes>
for clarification.

When separated from the distribution, all original POD documentation is
covered by the
L<Creative Commons Attribution-Share Alike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/us/legalcode>.
See the
L<clarification of the CCA-SA3.0|http://creativecommons.org/licenses/by-sa/3.0/us/>.


=for git $Id: file_chooser.xs c629eeb 2010-09-27 04:12:30Z sanko@cpan.org $

=cut