Label Options

The following is a comprehensive list of options for Labels:

-anchor => 'n' | 'ne' | 'e' | 'se' | 's' | 'sw' | 'w' | 'nw' | ' center ' Causes the text to stick to that position in the Label widget. This won't be obvious unless the Label is forced to be larger than standard size. -background => color Sets the background color of the Label to color. -bitmap => bitmap Displays the bitmap contained in bitmap instead of text. -borderwidth => amount Changes the width of the edges of the Label. -cursor => cursorname Changes the cursor to cursorname when the mouse is over this widget. -font => fontname Indicates that the text in the widget will be displayed with fontname. -foreground => color Changes the text of the Button (or the bitmap) to color. -height => amount Sets the height of the Label to amount ; amount is a valid screen distance. -highlightbackground => color Sets the color of the focus rectangle when the widget is not in focus to color. -highlightcolor => color Sets the color of the focus rectangle when the widget has focus to color. -highlightthickness => amount Sets the width of the focus rectangle. Default is 0 for the Label. -image => imgptr Displays the image to which imgptr points, instead of text. -justify => 'left' | 'right' | ' center ' Sets the side of the Label against which multiline text will justify. -padx => amount Adds extra space inside the edge to the left and right of the Label. -pady => amount Adds extra space inside the edge to the top and bottom of the Label. -relief => ' flat ' | 'groove' | 'raised' | 'ridge' | 'sunken' Changes the type of edges drawn around the Button. -takefocus => 0 | 1 | undef Changes the ability of the Label to have the focus or not. -text => text Displays a text string in the Label. -textvariable => \$variable Points to the variable containing text to be displayed in the Label. Label will change automatically as $variable changes. -underline => n Causes the nth character to be underlined. Allows that key to invoke the widget when it has the focus. Default value is -1 (no character underlined). -width => amount Causes the Label width to be amount. -wraplength => amount Indicates that the text in the Label will wrap when it gets longer than amount. Label

Option name

.Xdefault's name

Class name

Default value

Current value

-activetile activeTile Tile undef
 
-anchor anchor Anchor center center
-background background Background #d9d9d9 #d9d9d9
-bd borderWidth
 
 
 
-bg background
 
 
 
-bitmap bitmap Bitmap
 
undef
-borderwidth borderWidth BorderWidth 2 2
-cursor cursor Cursor
 
undef
-disabledtile disabledTile Tile undef
 
-fg foreground
 
 
 
-font font Font Helvetica -12 bold Tk::Font=SCALAR(0x83649a0)
-foreground foreground Foreground Black Black
-height height Height 0 0
-highlightbackground highlightBackground HighlightBackground #d9d9d9 #d9d9d9
-highlightcolor highlightColor HighlightColor Black Black
-highlightthickness highlightThickness HighlightThickness 0 0
-image image Image undef undef
-justify justify Justify center center
-offset offset Offset 0 0 ARRAY(0x86948a4)
-padx padX Pad 1 1
-pady padY Pad 1 1
-relief relief Relief flat flat
-takefocus takeFocus TakeFocus 0 0
-text text Text
 
 
-textvariable textVariable Variable
 
undef
-tile tile Tile undef
 
-underline underline Underline -1 -1
-width width Width 0 0
-wraplength wrapLength WrapLength 0 0

转载于:https://www.cnblogs.com/greencolor/archive/2011/06/13/2080114.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值