in reply to Clearing entry boxes in a GUI?
#!/usr/bin/perl -w use strict; use Tk; my $Main = MainWindow->new(); my $text = "foobar"; my $Entry = $Main-> Entry( -textvariable => \$text )-> pack( -expand => 1, -fill => 'x' ); my $Button = $Main-> Button( -text => 'Clear', -width => 20, #choose one of the following #-command => sub { $text = '' } #-command => sub { $Entry->delete( 0, 'end' ) } )->pack(); MainLoop;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: (ichimunki) Re: Clearing entry boxes in a GUI?
by ralfthewise (Sexton) on Jun 21, 2001 at 22:27 UTC | |
by ichimunki (Priest) on Jun 21, 2001 at 22:38 UTC | |
by ralfthewise (Sexton) on Jun 21, 2001 at 23:34 UTC | |
by ichimunki (Priest) on Jun 22, 2001 at 19:02 UTC |