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.
In reply to Optionmenu Variable in Name by shortyfw06
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |