FBox(3pm)
π NAME π
Tk::FBox β a file dialog, bestie. yes it's giving file-picker realness β¨
π¦ SYNOPSIS π¦
use Tk::FBox;
$file = $mw->FBox(...)->Show;
πΈ DESCRIPTION πΈ
Okay so Tk::FBox is the dialog implementation lurking behind the getOpenFile, getSaveFile, and chooseDirectory method calls in the Unix/X11 world. Like, it's the main character behind the scenes π. Because of that, it supports all the options those methods take, plus these extra ones:
-sortcmd => sub { $_[0] cmp $_[1] }β you're specifying a callback that changes how the icons get sorted in theIconListwidget. By default, perl'scmpoperator is what's doing the sorting, no cap.
Straight from the source code, and I quote:
# 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]});
This is an experimental option! π proceed with caution, bestie.
-type => $typeβ this one's the vibe check on what you're picking. It should beopenfor choosing existing files to open (that's the default, iykyk),savefor choosing existing or non-existing files to save, ordirfor choosing directories. π-filter => $globβ a file glob that restricts which files get displayed. Heads up though: this is only active if there are no-filetypesdefined. π-force => $boolβ if it's true, then there will be no dialog if a file already exists. it just... does the thing. π
π COPYRIGHT π
The original tkfbox.tcl from Tcl/Tk is:
Copyright (c) 1994-1996 Sun Microsystems, Inc.
See the file "license.terms" for information on usage and redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
Translated to Perl/Tk by Slaven Rezic <srezic@cpan.org>.
β SEE ALSO β
Tk::getOpenFile, Tk::IconList.
and that's the whole page, bestie π«Ά this is FBox(3pm) from the User Contributed Perl Documentation collection β perl v5.40.1, dated 2025-04-13. slay, go pick some files π
β¨
π¦ where this page comes from
- debian trixie: perl-tk 1:804.036+dfsg1-5
- ubuntu questing: perl-tk 1:804.036+dfsg1-5
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms