in reply to Setting options in Tk::Optionmenu without the callback?
(actually, I'm hoping there's an easier work-around that I'm missing).
It's crude and nasty, but it's a lot simpler than creating your own widget.
I had a go at that a while ago and it's definitely not for the faint hearted. Or even the bold and brassy if they have any sort of time contstraints.
my $changed = 0; sub show_choice { $changed = 0, return if $changed; print "got: ", shift, "\n" } sub change_ops { my $op = shift; my @newoptions = map { ++$. } ( 0 .. 3 ); $changed = 1; $op->configure( -options => \@newoptions ); }
|
|---|