ppm で Win32-GUI をインストールする
ppm> install Win32-GUIHello, world
まずは基本の Hello, world から。
use strict;
use utf8;
use Win32::GUI;
my $main = Win32::GUI::Window->new(-name => 'Main',
-width => 100,
-height => 100);
$main->AddLabel(-text => "Hello, world");
$main->Show();
Win32::GUI::Dialog();
sub Main_Terminate {
-1;
}
ButtonWindow を閉じるボタンを付ける。
use strict;
use utf8;
use Win32::GUI;
my $main = Win32::GUI::Window->new(-name => 'Main',
-title => "Main Window",
-width => 200,
-height => 100);
$main->AddLabel(-text => "Hello, world");
$main->AddButton(-name => "Button1",
-text => "Close this window",
-pos => [50, 30]);
$main->Show();
Win32::GUI::Dialog();
sub Main_Terminate {
-1;
}
sub Button1_Click {
&Main_Terminate();
}
0 件のコメント:
コメントを投稿