⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 listbox.pl

📁 perl learn perl by examples
💻 PL
字号:
use Tk;
$top = MainWindow->new();
$wine_list = $top->Listbox("-width" => 20, "-height" => 5
           )->pack();
$wine_list->insert('end', # Insert at end, the following list
           "Napa Valley Chardonnay", "Cabernet Sauvignon",
           "Dry Chenin Blanc", "Merlot",
           "Sangiovese");
$wine_list->bind('<Double-1>', \&buy_wine);

sub buy_wine {
    my $wine = $wine_list->get('active');
    return if (!$wine);
    print "Ah, '$wine'. An excellent choice\n";
    # Remove the wine from the list
    $wine_list->delete('active');
}

MainLoop();

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -