If I'm reading the docs and examples correctly, I think you should be able to do something like this (untested):
#!/usr/bin/perl use warnings; use strict; use Tk; use Tk::JComboBox; my $mw = MainWindow->new; my $lang1; my $lang2; my @choices = qw(en fr de it sp); my $drop1 = $mw->JComboBox( -textvariable => \$lang1, -choices => [@choices], -entrybackground => 'white', -background=> 'white', -disabledbackground=>'grey', -autofind => { -enable => 1 }, -selectcommand => \&changeDrop2 )->pack(); my $drop2 = $mw->JComboBox( -textvariable => \$lang2, -choices => [@choices], -entrybackground => 'white', -background=> 'white', -disabledbackground=>'grey', -autofind => { -enable => 1 }, )->pack(); MainLoop; sub changeDrop2 { my ($drop1, $selIndex, $selValue, $selName) = @_; my @restricted = grep { $_ ne $selValue } @choices; $drop2->configure(-choices => [@restricted]); $mw->update; }
In reply to Re: Multiple Tk::JComboBox with unique values selectable
by Mr. Muskrat
in thread Multiple Tk::JComboBox with unique values selectable
by welleozean
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |