Sanko Robinson > FLTK-0.532009 > FLTK::file_chooser



Annotate this POD


View/Report Bugs
Module Version: 0.532006   Source  


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

Description ^

Functions ^


my $directory = FLTK::dir_chooser( $message, $directory, $relative );

Show a file chooser dialog and pick a directory.

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

Import this function with the :dialog or :default tags.


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.

$message is a string used to title the window.

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

$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 $filename is undef, then the last filename that was choosen is used, unless the $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 file_chooser( ) is called.

Import this function with the :dialog or :default tags.


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.

Import this function with the :dialog tag.

Author ^

Sanko Robinson <> -

License and Legal ^

Copyright (C) 2008-2010 by Sanko Robinson <>

This program is free software; you can redistribute it and/or modify it under the terms of The Artistic License 2.0. See the LICENSE file included with this distribution or notes on the Artistic License 2.0 for clarification.

When separated from the distribution, all original POD documentation is covered by the Creative Commons Attribution-Share Alike 3.0 License. See the clarification of the CCA-SA3.0.

syntax highlighting: