The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.3
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sh \" Subsection heading
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings.  \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote.  | will give a
.\" real vertical bar.  \*(C+ will give a nicer C++.  Capital omega is used to
.\" do unbreakable dashes and therefore won't be available.  \*(C` and \*(C'
.\" expand to `' in nroff, nothing in troff, for use with C<>.
.tr \(*W-|\(bv\*(Tr
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
.    ds -- \(*W-
.    ds PI pi
.    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
.    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
.    ds L" ""
.    ds R" ""
.    ds C` ""
.    ds C' ""
'br\}
.el\{\
.    ds -- \|\(em\|
.    ds PI \(*p
.    ds L" ``
.    ds R" ''
'br\}
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
.\" entries marked with X<> in POD.  Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.if \nF \{\
.    de IX
.    tm Index:\\$1\t\\n%\t"\\$2"
..
.    nr % 0
.    rr F
.\}
.\"
.\" For nroff, turn off justification.  Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.hy 0
.if n .na
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear.  Run.  Save yourself.  No user-serviceable parts.
.    \" fudge factors for nroff and troff
.if n \{\
.    ds #H 0
.    ds #V .8m
.    ds #F .3m
.    ds #[ \f1
.    ds #] \fP
.\}
.if t \{\
.    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
.    ds #V .6m
.    ds #F 0
.    ds #[ \&
.    ds #] \&
.\}
.    \" simple accents for nroff and troff
.if n \{\
.    ds ' \&
.    ds ` \&
.    ds ^ \&
.    ds , \&
.    ds ~ ~
.    ds /
.\}
.if t \{\
.    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
.    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
.    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
.    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
.    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
.    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
.    \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
.    \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
.    \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
.    ds : e
.    ds 8 ss
.    ds o a
.    ds d- d\h'-1'\(ga
.    ds D- D\h'-1'\(hy
.    ds th \o'bp'
.    ds Th \o'LP'
.    ds ae ae
.    ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "Tk::JFileDialog 3"
.TH Tk::JFileDialog 3 "2007-06-09" "perl v5.8.7" "User Contributed Perl Documentation"
.SH "NAME"
Tk::JFileDialog \- A highly configurable File Dialog widget for Perl/Tk.  
.SH "DESCRIPTION"
.IX Header "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
\&\s-1OK\s0, Rescan, and Cancel.  Note that the labels for all subwidgets (including the text
for the buttons and Checkbox) are configurable for foreign language support.
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
.Vb 4
\& my $LoadDialog = $main\->JFileDialog(
\&        \-Title =>'Please select a file:',
\&        \-Create => 0
\& );
.Ve
.Sh "Usage Description"
.IX Subsection "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.
.Sh "Example Code"
.IX Subsection "Example Code"
The following code creates a FileDialog and calls it.  Note that perl5.002gamma is
required.
.RE
.IP "\(bu"
.Vb 1
\& #!/usr/local/bin/perl \-w
.Ve
.PP
.Vb 3
\& use Tk;
\& use Tk::JFileDialog;
\& use strict;
.Ve
.PP
.Vb 3
\& my($main) = MainWindow\->new;
\& my($Horiz) = 1;
\& my($fname);
.Ve
.PP
.Vb 2
\& my($LoadDialog) = $main\->JFileDialog(\-Title =>'This is my title',
\&                                    \-Create => 0);
.Ve
.PP
.Vb 2
\& $LoadDialog\->configure(\-FPat => '*pl',
\&                       \-ShowAll => 'NO');
.Ve
.PP
.Vb 3
\& $main\->Entry(\-textvariable => \e$fname)
\&        \->pack(\-expand => 1,
\&               \-fill => 'x');
.Ve
.PP
.Vb 10
\& $main\->Button(\-text => 'Kick me!',
\&              \-command => sub {
\&                  $fname = $LoadDialog\->Show(\-Horiz => $Horiz);
\&                  if (!defined($fname)) {
\&                      $fname = "Fine,Cancel, but no Chdir anymore!!!";
\&                      $LoadDialog\->configure(\-Chdir =>'NO');
\&                  }
\&              })
\&        \->pack(\-expand => 1,
\&               \-fill => 'x');
.Ve
.PP
.Vb 4
\& $main\->Checkbutton(\-text => 'Horizontal',
\&                   \-variable => \e$Horiz)
\&        \->pack(\-expand => 1,
\&               \-fill => 'x');
.Ve
.PP
.Vb 6
\& $main\->Button(\-text => 'Exit',
\&              \-command => sub {
\&                  $main\->destroy;
\&              })
\&        \->pack(\-expand => 1,
\&               \-fill => 'x');
.Ve
.PP
.Vb 1
\& MainLoop;
.Ve
.PP
.Vb 1
\& print "Exit Stage right!\en";
.Ve
.PP
.Vb 1
\& exit;
.Ve
.SH "METHODS"
.IX Header "METHODS"
The following non-standard method may be used with a FileDialog object
.Sh "Show"
.IX Subsection "Show"
.RS 4
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:
.Sp
.Vb 1
\&  $fd\->Show(\-Title => 'Ooooh, Preeeeeety!');
.Ve
.Sp
is the same as this code snippet:
.Sp
.Vb 2
\&  $fd\->configure(\-Title => 'Ooooh, Preeeeeety!');
\&  $fd\->Show;
.Ve
.SH "CONFIGURATION"
.IX Header "CONFIGURATION"
.Vb 2
\&        Any of the following configuration items may be set via the configure (or Show) method,
\&or retrieved via the cget method.
.Ve
.Sh "\fIFlags\fP"
.IX Subsection "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.
.Sh "\-Chdir"
.IX Subsection "-Chdir"
Enable the user to change directories. The default is 1. If disabled, the directory
list box will not be shown.
.Sh "\-Create"
.IX Subsection "-Create"
Enable the user to specify a file that does not exist. If not enabled, and the user
specifies a non-existent file, a dialog box will be shown informing the user of the
error (This Dialog Box is configurable via the EDlg* switches, below).
.Sp
default: 1
.Sh "\-ShowAll"
.IX Subsection "-ShowAll"
Determines whether hidden files (.*) are displayed in the File and Directory Listboxes.
The default is 0. The Show All Checkbox reflects the setting of this switch.
.Sh "\-DisableShowAll"
.IX Subsection "-DisableShowAll"
Disables the ability of the user to change the status of the ShowAll flag. The default
is 0 (the user is by default allowed to change the status).
.Sh "\-DisableFPat"
.IX Subsection "-DisableFPat"
Disables the ability of the user to change the file selection pattern. The default
is 0 (the user is by default allowed to change the status).
.Sh "\-Grab"
.IX Subsection "-Grab"
Enables the File Dialog to do an application Grab when displayed. The default is 1.
.Sh "\-History"
.IX Subsection "-History"
Used with the \*(L"\-HistFile\*(R" option.  Specifies how many files to retain in the 
history list.  The default is 0 (keep all).
.Sh "\-HistDeleteOk"
.IX Subsection "-HistDeleteOk"
If set, allows user to delete items from the history dropdown list and thus the 
history file.
.Sh "\-HistUsePath"
.IX Subsection "-HistUsePath"
If set, the path is set to that of the last file selected from the history.
.Sh "\-HistUsePathButton"
.IX Subsection "-HistUsePathButton"
If set, the path is set to that of the last file selected from the history.
.Sh "\-HistFile"
.IX Subsection "-HistFile"
Enables the keeping of a history of the previous files / directories selected.  
The file specified must be writable.  If specified, a history of up to 
\&\*(L"\-History\*(R" number of files will be kept and will be displayed in a \*(L"JBrowseEntry\*(R" 
combo-box permitting user selection.
.Sh "\-PathFile"
.IX Subsection "-PathFile"
Specifies a file containing a list of \*(L"favorite paths\*(R" bookmarks to show in a 
dropdown list allowing quick-changes in directories.
.Sh "\-Horiz"
.IX Subsection "-Horiz"
True sets the File List box to be to the right of the Directory List Box. If 0, the
File List box will be below the Directory List box. The default is 1.
.Sh "\-QuickSelect"
.IX Subsection "-QuickSelect"
Default 1, if set to 0, user must invoke the \*(L"\s-1OK\s0\*(R" button to complete selection. 
If 1 or 2, clicking item in the history menu automatically completes the 
selection.  If 2, single-clicking a file in the file list completes selection
(otherwise, a double-click is required).
.Sh "\-SelDir"
.IX Subsection "-SelDir"
If 1 or 2, enables selection of a directory rather than a file, and disables the
actions of the File List Box. Setting to 2 allows selection of either a file \s-1OR\s0 a directory.  The default is 0.
.Sh "\fISpecial\fP"
.IX Subsection "Special"
.Sh "\-FPat"
.IX Subsection "-FPat"
Sets the default file selection pattern. The default is '*'. Only files matching
this pattern will be displayed in the File List Box.
.Sh "\-Geometry"
.IX Subsection "-Geometry"
Sets the geometry of the File Dialog. Setting the size is a dangerous thing to do.
If not configured, or set to '', the File Dialog will be centered.
.Sh "\-SelHook"
.IX Subsection "-SelHook"
SelHook is configured with a reference to a routine that will be called when a file
is chosen. The file is called with a sole parameter of the full path and file name
of the file chosen. If the Create flag is disabled (and the user is not allowed
to specify new files), the file will be known to exist at the time that SelHook is
called. Note that SelHook will also be called with directories if the SelDir Flag
is enabled, and that the FileDialog box will still be displayed. The FileDialog box
should \fBnot\fR be destroyed from within the SelHook routine, although it may generally
be configured.
.Sp
SelHook routines return 0 to reject the selection and allow the user to reselect, and
any other value to accept the selection. If a SelHook routine returns non\-zero, the
FileDialog will immediately be withdrawn, and the file will be returned to the caller.
.Sp
There may be only one SelHook routine active at any time. Configuring the SelHook
routine replaces any existing SelHook routine. Configuring the SelHook routine with
0 removes the SelHook routine. The default SelHook routine is undef.
.Sh "\fIStrings\fP"
.IX Subsection "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)
.Sh "\-SelectMode"
.IX Subsection "-SelectMode"
Sets the selectmode of the File Dialog.  If not configured it will be defaulted
to 'single'.  If set to 'multiple', then the user may select more than one file 
and a comma-delimited list of all selected files is returned.  Otherwise, only 
a single file may be selected.  
.Sp
\&\fB\-File\fR  The file selected, or the default file. The default is ''.
.Sp
\&\fB\-Path\fR  The path of the selected file, or the initial path. The default is \f(CW$ENV\fR{'\s-1HOME\s0'}.
.Sh "\fILabels and Captions\fP"
.IX Subsection "Labels and Captions"
For support of internationalization, the text on any of the subwidgets may be
changed.
.Sp
\&\fB\-Title\fR  The Title of the dialog box. The default is 'Select File:'.
.Sp
\&\fB\-DirLBCaption\fR  The Caption above the Directory List Box. The default is 'Directories'.
.Sp
\&\fB\-FileLBCaption\fR  The Caption above the File List Box. The default is 'Files'.
.Sp
\&\fB\-FileEntryLabel\fR  The label to the left of the File Entry. The Default is 'Filename:'.
.Sp
\&\fB\-PathEntryLabel\fR  The label to the left of the Path Entry. The default is 'Pathname:'.
.Sp
\&\fB\-FltEntryLabel\fR  The label to the left of the Filter entry. The default is 'Filter:'.
.Sp
\&\fB\-ShowAllLabel\fR  The text of the Show All Checkbutton. The default is 'Show All'.
.Sh "\fIButton Text\fP"
.IX Subsection "Button Text"
For support of internationalization, the text on the three buttons may be changed.
.Sp
\&\fB\-OKButtonLabel\fR  The text for the \s-1OK\s0 button. The default is '\s-1OK\s0'.
.Sp
\&\fB\-RescanButtonLabel\fR  The text for the Rescan button. The default is 'Refresh'.
.Sp
\&\fB\-CancelButtonLabel\fR  The text for the Cancel button. The default is 'Cancel'.
.Sp
\&\fB\-HomeButtonLabel\fR  The text for the Home directory button. The default is 'Home'.
.Sp
\&\fB\-CWDButtonLabel\fR  The text for the Current Working Directory button. 
The default is 'C~WD'.
.Sh "\fIError Dialog Switches\fP"
.IX Subsection "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.
.Sh "\-EDlgTitle"
.IX Subsection "-EDlgTitle"
The title of the Error Dialog Box. The default is 'File does not exist!'.
.Sh "\-EDlgText"
.IX Subsection "-EDlgText"
The message of the Error Dialog Box. The variables \f(CW$path\fR, \f(CW$file\fR, and \f(CW$filename\fR
(the full path and filename of the selected file) are available. The default
is \fI\*(L"You must specify an existing file.\en(\e$filename not found)\*(R"\fR
.SH "Author"
.IX Header "Author"
\&\fBJim Turner\fR
.Sp
turnerjw at mesh . net
.Sp
A derived work from Tk::FileDialog, by:
.Sp
\&\fBBrent B. Powers, Merrill Lynch (B2Pi)\fR
.Sp
powers@ml.com
.Sp
This code may be distributed under the same conditions as Perl itself.