NAME
Tk::EntryDialog - Dialog widget with text entry.
SYNOPSIS
$d = $w -> EntryDialog ( -font => '*-helvetica-medium-r-*-*-12-*',
-defaultentry => 'Text in entry widget' );
$d -> WaitForInput;
DESCRIPTION
The -font option defaults to *-helvetica-medium-r-*-*-12-*.
The -defaultentry option supplies the default text in the Entry
widget.
After WaitForEntry is called, clicking on the 'Accept' button or
pressing Enter in the text entry widget, closes the dialog and returns
the text in the entry box.
The WaitForEntry method does not destroy the window. Instead WaitForEntry
unmaps the dialog box from the display. To de-allocate the widget, you
must explicitly call $w -> destroy or $w -> DESTROY.
Refer to the example
Refer to the Tk::options man page for a description of the standard
Perl/Tk widget options.
Example:
use Tk;
use Tk::EntryDialog;
my $w = new MainWindow;
my $b = $w -> Button (-text => 'Dialog',
-command => sub{&show_dialog($w)}) -> pack;
sub show_dialog {
my ($w) = @_;
my $e;
if (not defined $e) {
$e = $w -> EntryDialog (-title => 'Enter Text');
$e -> configure (-defaultentry => 'default text');
}
my $resp = $ewidget -> WaitForInput;
return $resp;
}
MainLoop;
VERSION
$Revision: 0.6 $
Licensed for free distribution under the terms of the
Perl Artistic License.
Written by Robert Allan Kiesling <rkiesling@mainmatter.com>