Charles.Forsyth20060303-partialeea662d19 years agoHistory
244 lines · 9.7 KB · Text
RawDownload
.TH OPTIONS 9.SH NAMEoptions \- Standard options supported by widgets.SH DESCRIPTIONThis manual entry describes the common configuration options supportedby widgets in the Tk toolkit.  Every widget does not necessarily supportevery option (see the manual entries for individual widgets for a listof the standard options supported by that widget), but if a widget doessupport an option with one of the names listed below, then the optionhas exactly the effect described below.For a description of kinds of values that can passed to the variousoptions, see.IR types (9)..PPIn the descriptions below, the name refers to theswitch used in class commands and \f5configure\fR widget commands toset this value.  For example, if an option's command-line switch is set to\f5-foreground\fR and there exists a widget \f5.a.b.c\fR, then thecommand.RS.EX\&.a.b.c configure -foreground black.EE.REmay be used to specify the value \f5black\fR for the option in thethe widget \f5.a.b.c\fR..TP.BI -activebackground " colour"Specifies background colour to use when drawing active elements.An element (a widget or portion of a widget) is active if themouse cursor is positioned over the element and pressing a mouse buttonwill cause some action to occur..TP.BI -activeforeground " colour"Specifies foreground colour to use when drawing active elements.See above for definition of active elements..TP.BI -actxReturns the current x position of the widget in screen coordinates..TP.BI -actyReturns the current y position of the widget in screen coordinates..TP.BI -actwidthReturns the current allocated width of the widget..TP.BI -actheightReturns the current allocated height of the widget..TP.BI -anchor " val"Specifies how the information in a widget (e.g. text or a bitmap)is to be displayed in the widget..I Valmust be one of the values \f5n\fR, \f5ne\fR, \f5e\fR, \f5se\fR,\f5s\fR, \f5sw\fR, \f5w\fR, \f5nw\fR, or \f5center\fR.For example, \f5nw\fR means display the information such that itstop-left corner is at the top-left corner of the widget..TP.B -background  \fIcolour\fP \fRor\fP -bg \fIcolour\fPSpecifies the normal background colour to use when displaying thewidget..TP.BI -bitmap " bitmap"Specifies a bitmap to display in the widget.The exact way in which the bitmap is displayed may be affected byother options such as \f5anchor\fR or \f5justify\fR.Typically, if this option is specified then it overrides otheroptions that specify a textual value to display in the widget;the \f5bitmap\fR option may be reset to an empty string to re-enablea text display.In widgets that support both \f5bitmap\fR and \f5image\fR options,\f5image\fR will usually override \f5bitmap\fR.For those widgets that support the \f5foreground\fR option, if the bitmap ismonochrome it is displayed using the foreground colour..TP.B -borderwidth \fIdist\fP \fRor\fP -bd \fIdist\fPSpecifies a non-negative value indicating the widthof the 3-D border to draw around the outside of the widget (if such aborder is being drawn;  the \f5relief\fR option typically determinesthis).  The value may also be used when drawing 3-D effects in theinterior of the widget..TP.B -disabledcolor  \fIcolour\fPSpecifies the foreground colour to use when drawing disabled widgets.Certain widgets can be disabled by use of their.B -stateoption..TP.B -font \fIfont\fPSpecifies the font to use when drawing text inside the widget..TP.B -foreground \fIcolour\fP or -fg \fIcolour\fPSpecifies the normal foreground colour to use when displaying the widget..TP.B -highlightcolor \fIcolour\fPSpecifies the colour to use for the traversal highlight rectangle that isdrawn around the widget when it has the input focus..TP.B -highlightthickness \fIdist\fPSpecifies a non-negative value indicating the width of the highlightrectangle to draw around the outside of the widget when it has theinput focus.If the value is zero, no focus highlight is drawn around the widget..TP.B -image \fIimage\fPSpecifies an image to display in the widget, which must have beencreated with the \f5image create\fR command.Typically, if the \f5image\fR option is specified then it overrides otheroptions that specify a bitmap or textual value to display in the widget;the \f5image\fR option may be reset to an empty string to re-enablea bitmap or text display.For those widgets that support the \f5foreground\fR option, if the image ismonochrome it is displayed using the foreground colour..TP.B -jump \fIboolean\fPFor widgets with a slider that can be dragged to adjust a value,such as scrollbars, this option determines whennotifications are made about changes in the value.If the value is false, updates are made continuously as theslider is dragged.If the value is true, updates are delayed until the mouse buttonis released to end the drag;  at that point a single notificationis made (the value ``jumps'' rather than changing smoothly)..TP.B -justify \fIval\fPWhen there are multiple lines of text displayed in a widget, thisoption determines how the lines line up with each other..I Valmust be one of \f5left\fR, \f5center\fR, or \f5right\fR.\f5Left\fR means that the lines' left edges all line up, \f5center\fRmeans that the lines' centers are aligned, and \f5right\fR meansthat the lines' right edges line up..TP.B -orient \fIorientation\fPFor widgets that can lay themselves out with either a horizontalor vertical orientation, such as scrollbars, this option specifieswhich orientation should be used..I Orientationmust be either \f5horizontal\fRor \f5vertical\fR..TP.B -padx \fIdist\fPSpecifies a non-negative value indicating how much extra spaceto request for the widget in the X-direction.When computing how large a window it needs, the widget willadd this amount to the width it would normally need (as determinedby the width of the things displayed in the widget);  if the geometrymanager can satisfy this request, the widget will end up with extrainternal space to the left and/or right of what it displays inside.Most widgets only use this option for padding text:  if they aredisplaying a bitmap or image, then they usually ignore paddingoptions..TP.B -pady \fIdist\fPSpecifies a non-negative value indicating how much extra spaceto request for the widget in the Y-direction.When computing how large a window it needs, the widget will addthis amount to the height it would normally need (as determined bythe height of the things displayed in the widget);  if the geometrymanager can satisfy this request, the widget will end up with extrainternal space above and/or below what it displays inside.Most widgets only use this option for padding text:  if they aredisplaying a bitmap or image, then they usually ignore paddingoptions..TP.B -relief \fIval\fPSpecifies the 3-D effect desired for the widget.  Acceptablevalues for.I val are \f5raised\fR, \f5sunken\fR, \f5flat\fR, \f5ridge\fR,and \f5groove\fR.The valueindicates how the interior of the widget should appear relativeto its exterior;  for example, \f5raised\fR means the interior ofthe widget should appear to protrude from the screen, relative tothe exterior of the widget..TP.B -selectbackground \fIcolour\fPSpecifies the background colour to use when displaying selecteditems..TP.B -selectborderwidth \fIdist\fPSpecifies a non-negative value indicating the widthof the 3-D border to draw around selected items..TP.B -selectforeground \fIcolour\fPSpecifies the foreground colour to use when displaying selecteditems..TP.B -takefocus \fIboolean\fPDetermines whether clicking on the widget will automaticallygive it the keyboard focus, and also whether the widgetwill become part of the keyboard focus list and made accessibleby keyboard navigation..TP.B -text \fIval\fPSpecifies a string,.IR val ,to be displayed inside the widget.  The way in whichthe string is displayed depends on the particular widget and may bedetermined by other options, such as \f5anchor\fR or \f5justify\fR..TP.B -underline \fIinteger\fPSpecifies the integer index of a character to underline in the widget.This option is used by the default bindings to implement keyboardtraversal for menu buttons and menu entries.0 corresponds to the first character of the text displayed in thewidget, 1 to the next character, and so on..TP.B -xscrollcommand \fIcommand\fPSpecifies the prefix for a command used to communicate with horizontalscrollbars.When the view in the widget's window changes (orwhenever anything else occurs that could change the display in ascrollbar, such as a change in the total size of the widget'scontents), the widget willgenerate a Tk command by concatenating.I commandandtwo numbers.Each of the numbers is a fraction between 0 and 1, which indicatesa position in the document.  0 indicates the beginning of the document,1 indicates the end, .333 indicates a position one third the way throughthe document, and so on.The first fraction indicates the first information in the documentthat is visible in the window, and the second fraction indicatesthe information just after the last portion that is visible.The command isthen passed to the Tk interpreter for execution.  Typically the\f5-xscrollcommand\fR option consists of the path name of a scrollbarwidget followed by.RB `` set '',e.g..RB `` ".x.scrollbar set" '':this will causethe scrollbar to be updated whenever the view in the window changes.If this option is not specified, then no command will be executed..TP.B -yscrollcommand \fIcommand\fPSpecifies the prefix for a command used to communicate with verticalscrollbars.  This option is treated in the same way as the\f5-xscrollcommand\fR option, except that it is used for verticalscrollbars and is provided by widgets that support vertical scrolling.See the description of \f5-xscrollcommand\fR for detailson how this option is used.