社内の Perl TK プロジェクトを引き継ぎました。BrowseEntry
ライブラリを使用するコンボボックスのデフォルト値をどのように設定するのか疑問に思っています。
コンボボックスの作成方法は次のとおりです。
$tm->ComboBox(
-variable => \$invoice_per_country,
-font => $main::UserPref->{'ListFont'},
-background => 'white',
-relief => 'groove',
-width => 40,
-takefocus => 1,
-listwidth => 60,
-listheight => scalar @invoice_countries,
-forcematch => '',
-options => [ @invoice_countries ],
-buttontakefocus => 0,
-disabledforeground => 'black',
-disabledbackground => 'white'
)
->pack(-side => 'left',
-anchor => 'nw');
には次のinvoice_countries
2 つの値が含まれます ('Canada', 'United States')
。値の順序を入れ替えずに米国をデフォルト値にする方法を考えていました (さらに国を追加します)。