shortyfw06 has asked for the wisdom of the Perl Monks concerning the following question:
This is my first perl code so be as critical as you like so I don't form any bad habits. I am trying to enable a specific number of optionmenus based on an entry variable. Here is the code.
my $lam_num_ent = $lam_mat_frm -> Entry(), -variable=> \$lam_num; my $ort_optmen1 = $lam_mat_frm -> Optionmenu(-options => [qw(-45 0 45 +90)], -variable => \$ort1); my $ort_optmen2 = $lam_mat_frm -> Optionmenu(-options => [qw(-45 0 45 +90)], -variable => \$ort2); my $ort_optmen3 = $lam_mat_frm -> Optionmenu(-options => [qw(-45 0 45 +90)], -variable => \$ort3); $ort_optmen1 -> configure(-state => 'disabled'); $ort_optmen2 -> configure(-state => 'disabled'); $ort_optmen3 -> configure(-state => 'disabled'); my $lam_data_button = $button_frm->Button(-text=>"Input Laminate Data" +, -command=> \&input_lam_data); sub input_lam_data { $n = 1; do { my @ort_optmen; $ort_optmen[$n] -> configure(-state => 'normal'); #This line is th +e issue $n = $n+1; } until ($n == $lam_num+1); }
Thank you for the help.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Optionmenu Variable in Name
by zentara (Cardinal) on Mar 08, 2012 at 18:07 UTC | |
by shortyfw06 (Beadle) on Mar 08, 2012 at 19:45 UTC | |
by zentara (Cardinal) on Mar 09, 2012 at 13:01 UTC |