scroll_test.pl
来自「perl learn perl by examples」· PL 代码 · 共 23 行
PL
23 行
use Tk;
$top = MainWindow->new();
$car_list = $top->Listbox("-width" => 15, "-height" => 4,
)->pack('-side' => 'left',
'-padx' => 10);
$car_list->insert('end', # Insert at end, the following list
"Acura", "BMW", "Ferrari", "Lotus", "Maserati",
"Lamborghini", "Chevrolet"
);
# Create scrollbar, and inform it about the list box
$scroll = $top->Scrollbar('-orient' => 'vertical',
'-width' => 10,
'-command' => ['yview', $car_list]
)->pack('-side' => 'left',
'-fill' => 'y',
'-padx' => 10);
# Inform listbox about the scrollbar
$car_list->configure('-yscrollcommand' => ['set', $scroll]);
MainLoop();
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?