<pre name="code" class="sql">#!/usr/local/bin/perl
use Tk;
use dbi;
#Global Variables
my $age = 10;
# Main Window
my $mw = new MainWindow;
#GUI Building Area
#Age
my $but1 = $mw -> Button(-text=>"view cpu", -command =>\&push_button1); ## 执行函数push_butto
my $but2 = $mw -> Button(-text=>"view memory", -command =>\&push_button2); ## 执行函数push_butto
my $but3 = $mw -> Button(-text=>"view disk", -command =>\&push_button3); ## 执行函数push_butto
my $but4 = $mw -> Button(-text=>"view err", -command =>\&push_button4); ## 执行函数push_butto
my $but5 = $mw -> Button(-text=>"view syslog",
Perl Tk grid 布局
最新推荐文章于 2016-03-07 13:54:00 发布
这篇博客展示了如何使用Perl的Tk模块创建GUI界面,包括使用grid布局管理器来安排按钮和文本区域,并实现按钮点击事件,如查看CPU、内存等信息。
摘要由CSDN通过智能技术生成