Andrew_Levenson has asked for the wisdom of the Perl Monks concerning the following question:
I'm back to working on my calculator again, and I decided to take a new approach using a loop to create buttons instead of writing every button.
How do I get Tk to execute a string of code following "command?" I've tried everything i've come up with.
Thanks in advance!
How do I get Tk to execute a string of code following "command?" I've tried everything i've come up with.
for(0..9){ $input=$_; $_ = $left_num -> Button( -text => "$input", -background => 'grey', -width => 5, -height => 2, -command => $number=$number==0||$equals!=0?$input:$number.$in +put, ) -> pack(); }
Thanks in advance!
C(qw/74 97 104 112/);sub C{while(@_){$c**=$C;print (map{chr($C!=$c?shift:pop)}$_),$C+=@_%2!=1?1:0}}
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Making a button execute a command: Tk
by eff_i_g (Curate) on Jan 12, 2007 at 22:00 UTC | |
Re: Making a button execute a command: Tk
by johngg (Canon) on Jan 12, 2007 at 23:00 UTC | |
Re: Making a button execute a command: Tk
by zentara (Archbishop) on Jan 13, 2007 at 11:17 UTC |
Back to
Seekers of Perl Wisdom