.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .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 .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "FBox 3" .TH FBox 3 2023-07-25 "perl v5.38.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Tk::FBox \- a file dialog .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 2 \& use Tk::FBox; \& $file = $mw\->FBox(...)\->Show; .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" \&\f(CW\*(C`Tk::FBox\*(C'\fR is the dialog implementation behind the \f(CW\*(C`getOpenFile\*(C'\fR, \&\f(CW\*(C`getSaveFile\*(C'\fR, and \f(CW\*(C`chooseDirectory\*(C'\fR method calls in the Unix/X11 world. As such, it supports all options for these methods and additionally: .ie n .IP "\-sortcmd => sub { $_[0] cmp $_[1] }" 4 .el .IP "\-sortcmd => sub { \f(CW$_\fR[0] cmp \f(CW$_\fR[1] }" 4 .IX Item "-sortcmd => sub { $_[0] cmp $_[1] }" Specified a callback for changing the sorting of the icons in the \&\f(CW\*(C`IconList\*(C'\fR widget. By default, perl's \f(CW\*(C`cmp\*(C'\fR operator will be used. .Sp From the source code: .Sp .Vb 4 \& # Using \-sortcmd is really strange :\-( \& # $top\->getOpenFile(\-sortcmd => sub { package Tk::FBox; uc $b cmp uc $a}); \& # or, un\-perlish, but useable (now activated in code): \& # $top\->getOpenFile(\-sortcmd => sub { uc $_[1] cmp uc $_[0]}); .Ve .Sp This is an experimental option! .ie n .IP "\-type => $type" 4 .el .IP "\-type => \f(CW$type\fR" 4 .IX Item "-type => $type" Type should be "open" for choosing existing files to open (default), "save" for choosing existing or non-existing files to save, or "dir" for choosing directories. .ie n .IP "\-filter => $glob" 4 .el .IP "\-filter => \f(CW$glob\fR" 4 .IX Item "-filter => $glob" A file glob to restrict displayed files. This is only active if no \&\fB\-filetypes\fR are defined. .ie n .IP "\-force => $bool" 4 .el .IP "\-force => \f(CW$bool\fR" 4 .IX Item "-force => $bool" If true, then there will be no dialog if a file already exists. .SH COPYRIGHT .IX Header "COPYRIGHT" The original tkfbox.tcl from Tcl/Tk is: .PP Copyright (c) 1994\-1996 Sun Microsystems, Inc. .PP See the file "license.terms" for information on usage and redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. .PP Translated to Perl/Tk by Slaven Rezic . .SH "SEE ALSO" .IX Header "SEE ALSO" Tk::getOpenFile, Tk::IconList.