#!/usr/bin/perl -w
use Tk;
use Tk::BrowseEntry;
use strict;
## (-title => 'Font Viewer' ) 标题,窗口的标题
my $mw = MainWindow->new(-title => 'xxoo');
##框体布局在顶部
my $f = $mw->Frame->pack(-side => 'top');
my $family = 'Courier';
##变量的引用,调用函数 布局水平 布局在左边
my $be = $f->BrowseEntry(-label => 'Family:', -variable => \$family,
-browsecmd => \&apply_font)->pack(-fill => 'x', -side => 'left');
$be->insert('end', sort $mw->fontFamilies);
my $size = 24;
my $bentry = $f->BrowseEntry(-label => 'Size:', -variable => \$size,
-browsecmd => \&apply_font)->pack(-side
pack 布局参数
最新推荐文章于 2023-09-13 21:00:00 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)