jinnicky has asked for the wisdom of the Perl Monks concerning the following question:
Is there a way to set the default value for an Optionbox? I'm using it to select a vendor and there are too many to fit on the screen using Tk::Optionmenu.
$selectVendor = $newTop->Optionbox(-text=>'Vendor', -command => \&select_vendor, -variable=> \$vsel, -font=>$variableFont, -options=> [@options], -rows =>15, )->pack(-side=>'left'); $vsel = "Amazon"; $selectVendor->configure(-variable => \$vsel);
Where 'Amazon' is the third entry in the @options list.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Tk::Optionbox default
by thundergnat (Deacon) on Apr 10, 2015 at 17:00 UTC | |
|
Re: Tk::Optionbox default
by golux (Chaplain) on Apr 10, 2015 at 17:40 UTC | |
by jinnicky (Sexton) on Apr 11, 2015 at 17:43 UTC |