Good Evening Monks!
I've posted a snippet of code that I need a Tk Button each time that it is pressed to do a different function. In this instance F0 button each time it is pressed it will turn ON the lights and then turn OFF the lights. The serial port code works....the button code does not reflect that. Thanks for pointing me in the right direction.
sub btnpress { my $btn = shift; if($btn eq 'C') { $display = ''; $buffer = ''; $dbuffer = ''; } if( $btn =~/F0/ ) { $display = sprintf "0 - Lights On", $dbuffer; $mw->bind('<ButtonPress-1>', \&one); } else { display($btn); } } sub one { $display = sprintf "0 - Lights Off", $dbuffer; }
In reply to Tk Button Press by PilotinControl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |