I have some working code now, but my buttons are each a unique name. They are $button1 through $button28. Here's the code that works and the sub for the first button:
my $button1 = $mw->Button(-text => "18-Letters",
-command => sub {print OUTFILE "18L\n"},
-command => \&change)->pack(-side => "top");
sub change {
$button1->configure(-background=>"yellow")
}
Aside from coding a sub for each button, could I use a if then to configure for an array? The goal is to change the color of the button once it is pressed.
my @btn = $button1-$button28;
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.