use Tk;
use strict;
use DBI;
# Main Window
my $mw = new MainWindow;
my $but1 = $mw -> Button(-text => "view cpu",-width=>300,
-command =>\&push_button);
$but1 -> pack();
my $but2 = $mw -> Button(-text => "view memory",-width=>300);
$but2 -> pack();
my $but3 = $mw -> Button(-text => "view disk",-width=>300);
$but3 -> pack();
my $but3 = $mw -> Button(-text => "view Event",-width=>300);
$but3 -> pack();
my $but4 = $mw -> Button(-text => "cleart",-width=>300,-command =>\&clear_button);
$but4 -> pack();
#Text Area
my $txt = $mw -> Text(-width=>300, -height=>100) -> pack();
MainLoop;
#This is executed when the button is pressed
sub push_button {
# system("cls");
my $dbName = 'dwh5';
my $dbUser = 'test';
my
Perl Tk pack布局示例
最新推荐文章于 2023-11-27 08:17:47 发布