in reply to More Perl/Tk help.
(If I am allowed a personal comment, I really hate Tk's way of using pass-by-reference to keep track of changes. It leads to spaghetti code real quick like.)# ... my $rw = $mw->Label(-textvariable => \$rightwrong, -foreground => $colour)->pack(-side=> 'bottom'); # ... if ($answer == $guess) { #count correct answers $correct++; $rightwrong = 'Correct!'; $rw->configure(-foreground => 'green'); }else{ $rightwrong = 'Wrong!'; $rw->configure(-foreground => 'red'); } # ...
Makeshifts last the longest.
|
|---|