Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
and I want to have a sub function for the change of ANY of the comboboxes.... something like...foreach my $row (1..222){ foreach my $col (1..5){ if ($col =~ '1' && $account !~ $Sheet->Cells($row,$col)->{'Val +ue'}){ $account = $Sheet->Cells($row,$col)->{'Value'}; @labels[$count] = $main->AddLabel( -text => $account, -top => $top, -left => $left ); $top += 15; @comboboxes[$count] = $main->AddCombobox( -name => $account."ComboBox", -top => $top, -left => $left, -width => 125, -height => 150, -tabstop => 1, -style => WS_VISIBLE | 3 | WS_VSCROLL ); $count += 1; $top += 25; } else { if ($col =~ '2'){ $value = $Sheet->Cells($row,$col)->{'Value'}; @comboboxes[$count-1]->InsertItem($value); } } } }
That doesn't work, obviously. If I hard code in a sub function with something that I KNOW will be valid, like "ACCOUNTNAMEComboBox_Change", then it works fine. Any thoughts? Josh Pavelsub @comboboxes_Change{ print "You changed somethin'.\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: variable sub function?
by chromatic (Archbishop) on May 30, 2002 at 14:40 UTC | |
by c-era (Curate) on May 30, 2002 at 14:54 UTC | |
|
Re: variable sub function?
by c-era (Curate) on May 30, 2002 at 14:26 UTC |