
1.pack is the most commonly used
2.The grID geometry manager has been improved greatly with the release of Tk 8.0 and subsequent porting to Perl.
3.The place geometry manager is the most tedious to use,because you have to determine exact coordinates (relative or absolute) for every single Widget.
4.the form geometry manager is like a combination of pack and place .
pack参数
-sIDe => 'left' | 'right' | ' top ' | 'bottom Puts the Widget against the specifIEd sIDe of the window or Frame -fill => ' none ' | 'x' | 'y'| 'both' Causes the Widget to fill the allocation rectangle in the specifIEd direction -expand => 1 | 0 Causes the allocation rectangle to fill the remaining space available in the window or Frame -anchor => 'n' | 'ne' | 'e' | 'se' | 's' | 'sw' | 'w' | 'nw' | ' center ' Anchors the Widget insIDe the allocation rectangle -after => $otherWidget Puts $Widget after $otherWidget in packing order -before => $otherWidget Puts $Widget before $otherWidget in packing order -in => $otherwindow Packs $Widget insIDe of $otherwindow rather than the parent of $Widget,which is the default -ipadx => amount Increases the size of the Widget horizontally by amount -ipady => amount Increases the size of the Widget vertically by amount -padx => amount @L_301_38@ Places padding on the left and right of the Widget -pady => amount Places padding on the top and bottom of the WidgetMethods Associated with pack: Unpacking a Widget:
$Widget->packForget( );RetrIEving pack information:
@List = $Widget->packInfo( ); disabling and enabling automatic resizing:
$Widget->packPropagate(0);Listing Widgets:
@List = $parentWidget->packSlaves( );
tk之Font:
Family The actual name of the font,e.g.,'Courier','Times',and so on. Size The size of the font in points. The larger the size,the larger the text displayed on the screen. A point is 1/72 of an inch. Negative values are interpreted as pixels. Weight Determines if the font is shown boldor not. The value 'normal' means it is not shown bold,and 'bold' makes the font thicker. Slant Shows straight up and down if 'roman' is used,and slanted if 'italic' is used. Underline If the value used with -underline is true,the text will be underlined. If false,the text will not be underlined. Overstrike If true,a line will be drawn through the center of the text.
If you are used to working with fonts on a Unix system,you are probably
Font使用:
(1)创建Font:
$code_font = $mw->fontCreate('code',-family => 'courier',
然后进行引用:
$mw->Button(-text => "Show Code",-font => 'code');
$mw->Button(-text => "Show Code2",-font => $code_font);
-size => 12); (2)$mw->FontConfigure($code_Font,-family => 'Verdana');
-font => ['courier','14','bold']# The same thing,but more verbose:-font => [-family => 'courier',-size => '14',-weight => 'bold']总结
以上是内存溢出为你收集整理的Perl/tk之font全部内容,希望文章能够帮你解决Perl/tk之font所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)