jagdish.eashwar has asked for the wisdom of the Perl Monks concerning the following question:
Where am I going wrong?use warnings; use strict; use Tk; my ($no,$upper_no,$mw); $mw = MainWindow->new; $mw->geometry("300x100"); $mw->title("PerlTk Test"); $mw->Label(-text => "Enter a 5 digit number") ->place(-relx => 0.0,-rely => 0.05); $mw->Entry(-takefocus => 1, -textvariable => \$upper_no, -width => 12) ->place(-relx => 0.50, -rely => 0.05); $mw->Button(-text => "Click to count upto that number and display them + below as you count", -wraplength => 250, -command => \&count) ->place(-relx => 0.5, -anchor => "center", -rely =>0.50); $mw->Label(-textvariable => \$no, -relief => 'sunken', -anchor => 'center') ->place(-relx =>0.0, -rely => 0.80, -relwidth => 1.0, -relheight = +> 0.2); MainLoop; sub count { if ($upper_no > 0) { $no = 0; while ($no < $upper_no) { $no++; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: displaying program status in perl tk
by jethro (Monsignor) on Feb 04, 2009 at 15:27 UTC | |
by Anonymous Monk on Feb 04, 2009 at 16:13 UTC | |
by robobunny (Friar) on Feb 04, 2009 at 16:59 UTC | |
by boblawblah (Scribe) on Feb 04, 2009 at 22:00 UTC | |
|
Re: displaying program status in perl tk
by zentara (Cardinal) on Feb 04, 2009 at 16:34 UTC | |
by jagdish.eashwar (Novice) on Feb 05, 2009 at 07:51 UTC | |
by zentara (Cardinal) on Feb 05, 2009 at 14:01 UTC | |
|
Re: displaying program status in perl tk
by balakrishnan (Monk) on Feb 06, 2009 at 07:52 UTC |