in reply to Setting options in Tk::Optionmenu without the callback?
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.
|
|---|