- 论坛徽章:
- 0
|
回复 6# 首天
use Tk;
my $mw = MainWindow->new;
my $icon = $mw->Photo('-format' => 'png',-file => '/directory/icon.png');#此处图片的路径可以是完整的路径
my $mw->iconimage($icon);#设定窗口标题的ico图标
$mw->title("Bad Window");
$mw->Label(-text => "This is an example of a window that looks bad\nwhen you don't
send any options to pack")->pack;
$mw->Checkbutton(-text => "I like it!")->pack;
$mw->Checkbutton(-text => "I hate it!")->pack;
$mw->Checkbutton(-text => "I don't care")->pack;
$mw->Button(-text => "Exit",
-command => sub { exit })->pack;
MainLoop; |
-
a.png
(4.36 KB, 下载次数: 50)
|