| 1 |
=head1 NAME |
| 2 |
|
| 3 |
Tk::FBox - a file dialog |
| 4 |
|
| 5 |
=for pm Tk/FBox.pm |
| 6 |
|
| 7 |
=for category Popups and Dialogs |
| 8 |
|
| 9 |
=head1 SYNOPSIS |
| 10 |
|
| 11 |
use Tk::FBox; |
| 12 |
$file = $mw->FBox(...)->Show; |
| 13 |
|
| 14 |
=head1 DESCRIPTION |
| 15 |
|
| 16 |
C<Tk::FBox> is the dialog implementation behind the C<getOpenFile>, |
| 17 |
C<getSaveFile>, and C<chooseDirectory> method calls in the Unix/X11 |
| 18 |
world. As such, it supports all options for these methods and |
| 19 |
additionally: |
| 20 |
|
| 21 |
=over |
| 22 |
|
| 23 |
=item -sortcmd => sub { $_[0] cmp $_[1] } |
| 24 |
|
| 25 |
Specified a callback for changing the sorting of the icons in the |
| 26 |
C<IconList> widget. By default, perl's C<cmp> operator will be used. |
| 27 |
|
| 28 |
From the source code: |
| 29 |
|
| 30 |
# Using -sortcmd is really strange :-( |
| 31 |
# $top->getOpenFile(-sortcmd => sub { package Tk::FBox; uc $b cmp uc $a}); |
| 32 |
# or, un-perlish, but useable (now activated in code): |
| 33 |
# $top->getOpenFile(-sortcmd => sub { uc $_[1] cmp uc $_[0]}); |
| 34 |
|
| 35 |
This is an experimental option! |
| 36 |
|
| 37 |
=item -type => $type |
| 38 |
|
| 39 |
Type should be "open" for choosing existing files to open (default), |
| 40 |
"save" for choosing existing or non-existing files to save, or "dir" |
| 41 |
for choosing directories. |
| 42 |
|
| 43 |
=item -filter => $glob |
| 44 |
|
| 45 |
A file glob to restrict displayed files. This is only active if no |
| 46 |
B<-filetypes> are defined. |
| 47 |
|
| 48 |
=item -force => $bool |
| 49 |
|
| 50 |
If true, then there will be no dialog if a file already exists. |
| 51 |
|
| 52 |
=back |
| 53 |
|
| 54 |
=head1 COPYRIGHT |
| 55 |
|
| 56 |
The original tkfbox.tcl from Tcl/Tk is: |
| 57 |
|
| 58 |
Copyright (c) 1994-1996 Sun Microsystems, Inc. |
| 59 |
|
| 60 |
See the file "license.terms" for information on usage and redistribution |
| 61 |
of this file, and for a DISCLAIMER OF ALL WARRANTIES. |
| 62 |
|
| 63 |
Translated to Perl/Tk by Slaven Rezic <[email protected]>. |
| 64 |
|
| 65 |
=head1 SEE ALSO |
| 66 |
|
| 67 |
L<Tk::getOpenFile>, L<Tk::IconList>. |