logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Tk::FBox - a file dialog

Description

       "Tk::FBox" is the dialog implementation behind the "getOpenFile", "getSaveFile", and "chooseDirectory"
       method calls in the Unix/X11 world. As such, it supports all options for these methods and additionally:

       -sortcmd => sub { $_[0] cmp $_[1] }
           Specified  a  callback  for  changing  the sorting of the icons in the "IconList" widget. By default,
           perl's "cmp" operator will be used.

           From the source code:

             # 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!

       -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.

       -filter => $glob
           A file glob to restrict displayed files. This is only active if no -filetypes are defined.

       -force => $bool
           If true, then there will be no dialog if a file already exists.

Name

       Tk::FBox - a file dialog

See Also

       Tk::getOpenFile, Tk::IconList.

perl v5.40.1                                       2025-04-13                                          FBox(3pm)

Synopsis

           use Tk::FBox;
           $file = $mw->FBox(...)->Show;

See Also