in reply to problem with Tk::JComboBox
Zentara already said the important things. But I think it really was your intention to have the selection of the second widget change when the first widget is selected as in your script. In that case you only need to change Zentaras script this way:
sub ComboBoxSelect { my $list = shift; print "Browsing $list\n"; if ($list == 1) { my @TestList1 = ('a','b','cde'); $box{2}{'obj'}->configure(-choices => \@TestList1,-state => 'norma +l'); } }
If you prefer to have separate browsecmd functions for your widgets, you still can do that with Zentaras version. Just give a subroutine reference as a fifth parameter to createComboBox
UPDATE: The original program of AnonMonk works when the line @TestList1 = ('1','3','125'); is moved out of the callback routine to the end of the Screen routine. Looks like a bug in JComboBox to me
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: problem with Tk::JComboBox
by zentara (Cardinal) on Sep 22, 2008 at 18:24 UTC | |
by jethro (Monsignor) on Sep 22, 2008 at 19:08 UTC | |
by zentara (Cardinal) on Sep 22, 2008 at 20:40 UTC | |
by jethro (Monsignor) on Sep 22, 2008 at 23:06 UTC | |
by zentara (Cardinal) on Sep 23, 2008 at 14:17 UTC | |
by Anonymous Monk on Sep 27, 2008 at 07:07 UTC | |
by jethro (Monsignor) on Sep 27, 2008 at 16:05 UTC |