in reply to Updating concatenated text on a Menubutton
Now normally I try to keep these sorts of globals to a minimum. But without going to OO data structures, it can be difficult to make this sort of data available to callbacks.my $bit_10_9; #yes, this is a horrible abuse of globals setbits( 0,0 ); my $bit_10_9_mb = $r2Frame->Menubutton( -textvariable => \$bit_10_9, -menuitems => [['command' => '01', -command => sub{ setbits(0,1); }] .... then sub setbits { $bit[10] = shift || 0; $bit[9] = shift || 0; $bit_10_9 = $bit_10 . $bit_9; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: (ichimunki) Re: Updating concatenated text on a Menubutton
by Fastolfe (Vicar) on Nov 27, 2001 at 02:27 UTC |