Brent B. Powers > Tk-FileDialog-1.3 > Tk::FileDialog

Download:
Tk-FileDialog-1.3.tar.gz

Dependencies

Annotate this POD

Related Modules

Win32::FileOp
File::Find
Tk::PathEntry
more...
By perlmonks.org

CPAN RT

New  2
Open  0
View/Report Bugs
Module Version: 1.3   Source  

NAME ^

Tk::FileDialog - A highly configurable File Dialog widget for Perl/Tk.

DESCRIPTION ^

The widget is composed of a number of sub-widgets, namely, a listbox for files and (optionally) directories, an entry for filename, an (optional) entry for pathname, an entry for a filter pattern, a 'ShowAll' checkbox (for enabling display of .* files and directories), and three buttons, namely OK, Rescan, and Cancel. Note that the labels for all subwidgets (including the text for the buttons and Checkbox) are configurable for foreign language support. The Listboxes will respond to characters typed over them with scrolling to the first line that starts with the given character (or next etc. if this character is not present).

SYNOPSIS ^

Usage Description

To use FileDialog, simply create your FileDialog objects during initialization (or at least before a Show). When you wish to display the FileDialog, invoke the 'Show' method on the FileDialog object; The method will return either a file name, a path name, or undef. undef is returned only if the user pressed the Cancel button.

Example Code

The following code creates a FileDialog and calls it. Note that perl5.002gamma is required.

METHODS ^

Show

Displays the file dialog box for the user to operate. Additional configuration items may be passed in at Show-time In other words, this code snippet:

  $fd->Show(-Title => 'Ooooh, Preeeeeety!');

is the same as this code snippet:

  $fd->configure(-Title => 'Ooooh, Preeeeeety!');
  $fd->Show;

Version

Returns the current Version of FileDialog

CONFIGURATION ^

Any of the following configuration items may be set via the configure (or Show) method, or retrieved via the cget method.

Flags

Flags may be configured with either 1,'true', or 'yes' for 1, or 0, 'false', or 'no' for 0. Any portion of 'true', 'yes', 'false', or 'no' may be used, and case does not matter.

-Chdir

-Create

-ShowAll

-DisableShowAll

-Grab

-Horiz

-SelDir

Special

-FPat

-Geometry

-SelHook

Strings

The following two switches may be used to set default variables, and to get final values after the Show method has returned (but has not been explicitly destroyed by the caller)

Labels and Captions

For support of internationalization, the text on any of the subwidgets may be changed.

Button Text

For support of internationalization, the text on the three buttons may be changed.

Error Dialog Switches

If the Create switch is set to 0, and the user specifies a file that does not exist, a dialog box will be displayed informing the user of the error. These switches allow some configuration of that dialog box.

-EDlgTitle

-EDlgText

Author ^

Brent B. Powers, Merrill Lynch (B2Pi)

powers@ml.com

This code may be distributed under the same conditions as Perl itself.

syntax highlighting: