mld has asked for the wisdom of the Perl Monks concerning the following question:
I want to get the value entered by the user in the "Entry" fiels desinged using Tk module, and pass as param to another script file.
As a first step I tried to get the value and print the value. It is not functioning properly.
Please find the code :
my $input='Enter the site address..';
my $mw = new MainWindow;
my $frm_name= $mw ->Frame()->pack();
my $label =$frm_name -> Label(-text=>"Site Address") -> pack();
my $txt =$frm_name ->Entry()->pack();
my $button = $frm_name -> Button(-text => "Quit",
-command => sub{
$inp=$txt->get();
print $inp; })->pack();
my $txt_area= $mw ->Text(-width=>10,-height=>5)->pack();
MainLoop;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Retrieving the value of entry fiels
by anna_black (Sexton) on Mar 31, 2009 at 06:38 UTC | |
|
Re: Retrieving the value of entry fiels
by Ish (Acolyte) on Mar 31, 2009 at 06:47 UTC |