Don't know if there is a better way, but:
sub change_ops { my @ops = @_; my @newoptions = map { ++$. } ( 0 .. 3 ); my $callback = $ops[0]->cget (-command); $ops[0]->configure( -command => undef ); $ops[0]->configure( -options => \@newoptions ); $ops[0]->configure( -command => $callback ); }
fixes the problem.
In reply to Re: Setting options in Tk::Optionmenu without the callback?
by GrandFather
in thread Setting options in Tk::Optionmenu without the callback?
by graff
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |