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

📄 scroll_test.pl

📁 perl learn perl by examples
💻 PL
字号:
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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -