"be consistent" | |
PerlMonks |
Re: Perl/TK get the Button's textby liverpole (Monsignor) |
on Jun 03, 2009 at 18:17 UTC ( [id://768104]=note: print w/replies, xml ) | Need Help?? |
Hi Aboveyou,
(Not to be confused with "high aboveyou" :-)) If you want to do this dynamically, so that it will work even after the button's text has changed, you can either use the -textvar option suggested above, or you can construct the button in two steps. For example, the first step would be something like:
and in the second step, a subroutine (which takes the button name as an argument) is configured as the command invoked when the button is pressed:
Obviously you can't do this in one step, as $button isn't defined until you have the return value from $mw->Button, and you need to pass $button to the subroutine. Here's a full example:
s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/
In Section
Seekers of Perl Wisdom
|
|