welleozean has asked for the wisdom of the Perl Monks concerning the following question:
Dear monks
I need a user to select from multiple dropdown menus always different values. In the example below I have 2 dropdoen menus (Tk::JComboBox) with language abbreviations. If the user picks "en" in the first dropdown, the same value should be not clickable in the second one (or the other way round)? Any Idea?
#!/usr/bin/perl use warnings; use strict; use Tk; use Tk::JComboBox; my $mw = MainWindow->new; my $lang1; my $lang2; my $drop1 = $mw->JComboBox( -textvariable => \$lang1, -choices => [qw(en fr de it sp)], -entrybackground => 'white', -background=> 'white', -disabledbackground=>'grey', -autofind => { -enable => 1 }, )->pack(); my $drop2 = $mw->JComboBox( -textvariable => \$lang2, -choices => [qw(en fr de it sp)], -entrybackground => 'white', -background=> 'white', -disabledbackground=>'grey', -autofind => { -enable => 1 }, )->pack(); MainLoop;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Multiple Tk::JComboBox with unique values selectable
by Mr. Muskrat (Canon) on Jan 29, 2016 at 17:22 UTC | |
by welleozean (Novice) on Jan 29, 2016 at 17:43 UTC |