Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
use Tk; use Tk::Label; use Tk::Photo; use Tk::Text; use Tk::Notebook; # module that is referenced use saracen_collect; my $mw = MainWindow->new; $mw->title("Data Collection - Saracen"); $mw->MainWindow->Frame(-relief=>'groove'); $mw->minsize(600,300); my $image = $mw->Photo(-file => "saraLogo2.gif"); $mw->Label(-image => 'image1')->pack(-side=> "left", -anchor => 'n'); my $tittle = $mw -> Label(-font => '16', -text => "Specify Host:")->pa +ck(-side => 'top', -anchor => 'w'); my $inp = $mw -> NoteBook(-ipady => '4', -borderwidth => 2, -relief => + 'flat')->pack(-side => 'left', -anchor => 'nw', -side => 'left'); my $tab1 = $inp->add( "Sheet 1", -label=>" IP "); my $f1 = $tab1 -> Frame(-relief => 'flat')->pack(-side => 'top', -anch +or => 'nw'); my $ipaddl = $f1 -> Label(-text => "IP ADDRESS:\t\t\t")->pack(-side => + 'left', -anchor => 'nw'); my $ipadde = $f1 -> Entry(-borderwidth => '5',-background => 'white')- +>pack(-side => 'right', -anchor => 'nw'); my $f2 = $tab1 -> Frame(-relief => 'flat')->pack(-side => 'bottom', -a +nchor => 'sw'); my $confpwdl = $f2 -> Label(-text => "CONFIRM PASSWORD:\t\t")->pack(-s +ide => 'left', -anchor => 'nw'); my $confpwde = $f2 -> Entry(-borderwidth => '5',-background => 'white' +)->pack(-side => 'right', -anchor => 'nw'); my $f3 = $tab1 -> Frame(-relief => 'flat')->pack(-side => 'bottom', -a +nchor => 'sw'); my $pwdl = $f3 -> Label(-text => "PASSWORD:\t\t\t")->pack(-side => 'le +ft', -anchor => 'nw'); my $pwde = $f3 -> Entry(-borderwidth => '5',-background => 'white')->p +ack(-side => 'right', -anchor => 'nw'); my $f4 = $tab1 -> Frame(-relief => 'flat')->pack(-side => 'bottom', -a +nchor => 'sw'); my $userl = $f4 -> Label(-text => "USER NAME:\t\t\t")->pack(-side => ' +left', -anchor => 'nw'); my $usere = $f4 -> Entry(-borderwidth => '5',-background => 'white')-> +pack(-side => 'right', -anchor => 'nw'); my $bf = $mw-> Frame(-pady => '5')->pack(-side => 'bottom', -anchor=>' +se'); my $cancel = $bf -> Button(-relief=> 'raised', -borderwidth => '2', -t +ext => "Cancel", -command => sub {exit;})->pack(-side => 'right',-pad +x => '20'); # It is here I am trying to make the button process the sub. my $next = $bf -> Button(-relief=> 'raised', -borderwidth => '2', -tex +t => "Finish", -command => sub {collect(\$ipadde); exit;})->pack(-sid +e => 'right'); MainLoop;
Cheers, Steve
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl/Tk processing entered text with button
by mawe (Hermit) on Feb 23, 2005 at 15:27 UTC | |
by strat (Canon) on Feb 24, 2005 at 07:45 UTC | |
by Anonymous Monk on Feb 23, 2005 at 15:44 UTC |