The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Tk::FileEntry - FileEntry widget with optional file selection box

SYNOPSIS

    use Tk::FileEntry;

    $fileentry = $parent->FileEntry(
        -filebitmap     => BITMAP,
        -command        => CALLBACK,
        -variable       => SCALARREF,
        );

DESCRIPTION

FileEntry is a composite widget for choosing files. It features a Tk::Label, Tk::Entry, and a Tk::Button.

When the button is clicked, a dialog for choosing a file will show up. The path of the chosen file will be inserted into the entry widget. The label is intended as caption for the entry widget.

This is useful if you want to provide a convenient way to select a file path.

WIDGET-SPECIFIC OPTIONS

Option: -filebitmap
Name: fileBitmap
Class: FileBitmap

Specifies the bitmap to be used for the button that invokes the File Dialog.

-command

A callback that is executed when a file is chosen.

Pressing enter in the entry widget will execute this callback. See "BINDINGS" in Tk::FileEntry.

-variable

Reference to variable that will be bound to the value of the entry widget. See Tk::options for more details on -variable.

-label

Defines the label text. Defaults to File:.

BINDINGS

Tk::FileEntry has default bindings to allow the execution of the callback when a user presses enter in the entry widget.

EXAMPLE

  use strict;
  use warnings;
  use Tk;
  use Tk::FileEntry;
  
  my $mw = tkinit();
  
  $mw->FileEntry->pack(-expand => 1, -fill => 'x');
  
  $mw->MainLoop();

BUGS

None yet. If you find one, please consider creating a bug report, e.g. via Github.

SEE ALSO

  • Tk::getOpenFile for details about the file selection dialog

  • Tk::Entry for details about the Entry widget

  • Tk for details about the Perl/Tk GUI library

There is a wiki for Tcl/Tk stuff on the web: http://wiki.tcl.tk/

KEYWORDS

fileentry, tix, widget, file selector

AUTHOR

Alexander Becker, <asb@cpan.org>

Original Author was Achim Bohnet <ach@mpe.mpg.de>.

This code is inspired by the documentation of FileEntry.n of the Tix4.1.0 distribution by Ioi Lam. The bitmap data are also from Tix4.1.0. For everything else:

COPYRIGHT

Copyright (C) 2013-2020 by Alexander Becker

Copyright (c) 1997-1998 Achim Bohnet. All rights reserved.

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.16.3 or, at your option, any later version of Perl 5 you may have available.