📄 options.htm
字号:
The value may have any of the forms acceptable to <B><A HREF="../TkLib/GetPixels.htm">Tk_GetPixels</A></B>.If a border has been specified for the insertioncursor (using the <B>insertBorderWidth</B> option), the borderwill be drawn inside the width specified by the <B>insertWidth</B>option.<P><DT>Command-Line Name: <B><A NAME="M-jump">-jump</A></B><DT>Database Name: <B>jump</B><DT>Database Class: <B>Jump</B><DD>For 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.The option's value must be a boolean of the form accepted by<B><A HREF="../TclLib/GetInt.htm">Tcl_GetBoolean</A></B>.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).<P><DT>Command-Line Name: <B><A NAME="M-justify">-justify</A></B><DT>Database Name: <B>justify</B><DT>Database Class: <B>Justify</B><DD>When there are multiple lines of text displayed in a widget, thisoption determines how the lines line up with each other.Must be one of <B>left</B>, <B>center</B>, or <B>right</B>.<B>Left</B> means that the lines' left edges all line up, <B>center</B>means that the lines' centers are aligned, and <B>right</B> meansthat the lines' right edges line up.<P><DT>Command-Line Name: <B><A NAME="M-orient">-orient</A></B><DT>Database Name: <B>orient</B><DT>Database Class: <B>Orient</B><DD>For widgets that can lay themselves out with either a horizontalor vertical orientation, such as scrollbars, this option specifieswhich orientation should be used. Must be either <B>horizontal</B>or <B>vertical</B> or an abbreviation of one of these.<P><DT>Command-Line Name: <B><A NAME="M-padx">-padx</A></B><DT>Database Name: <B>padX</B><DT>Database Class: <B>Pad</B><DD>Specifies a non-negative value indicating how much extra spaceto request for the widget in the X-direction.The value may have any of the forms acceptable to <B><A HREF="../TkLib/GetPixels.htm">Tk_GetPixels</A></B>.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.<P><DT>Command-Line Name: <B><A NAME="M-pady">-pady</A></B><DT>Database Name: <B>padY</B><DT>Database Class: <B>Pad</B><DD>Specifies a non-negative value indicating how much extra spaceto request for the widget in the Y-direction.The value may have any of the forms acceptable to <B><A HREF="../TkLib/GetPixels.htm">Tk_GetPixels</A></B>.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.<P><DT>Command-Line Name: <B><A NAME="M-relief">-relief</A></B><DT>Database Name: <B>relief</B><DT>Database Class: <B>Relief</B><DD>Specifies the 3-D effect desired for the widget. Acceptablevalues are <B>raised</B>, <B>sunken</B>, <B>flat</B>, <B>ridge</B>,<B>solid</B>, and <B>groove</B>.The valueindicates how the interior of the widget should appear relativeto its exterior; for example, <B>raised</B> means the interior ofthe widget should appear to protrude from the screen, relative tothe exterior of the widget.<P><DT>Command-Line Name: <B><A NAME="M-repeatdelay">-repeatdelay</A></B><DT>Database Name: <B>repeatDelay</B><DT>Database Class: <B>RepeatDelay</B><DD>Specifies the number of milliseconds a button or key must be helddown before it begins to auto-repeat. Used, for example, on theup- and down-arrows in scrollbars.<P><DT>Command-Line Name: <B><A NAME="M-repeatinterval">-repeatinterval</A></B><DT>Database Name: <B>repeatInterval</B><DT>Database Class: <B>RepeatInterval</B><DD>Used in conjunction with <B>repeatDelay</B>: once auto-repeatbegins, this option determines the number of milliseconds betweenauto-repeats.<P><DT>Command-Line Name: <B><A NAME="M-selectbackground">-selectbackground</A></B><DT>Database Name: <B>selectBackground</B><DT>Database Class: <B>Foreground</B><DD>Specifies the background color to use when displaying selecteditems.<P><DT>Command-Line Name: <B><A NAME="M-selectborderwidth">-selectborderwidth</A></B><DT>Database Name: <B>selectBorderWidth</B><DT>Database Class: <B>BorderWidth</B><DD>Specifies a non-negative value indicating the widthof the 3-D border to draw around selected items.The value may have any of the forms acceptable to <B><A HREF="../TkLib/GetPixels.htm">Tk_GetPixels</A></B>.<P><DT>Command-Line Name: <B><A NAME="M-selectforeground">-selectforeground</A></B><DT>Database Name: <B>selectForeground</B><DT>Database Class: <B>Background</B><DD>Specifies the foreground color to use when displaying selecteditems.<P><DT>Command-Line Name: <B><A NAME="M-setgrid">-setgrid</A></B><DT>Database Name: <B>setGrid</B><DT>Database Class: <B>SetGrid</B><DD>Specifies a boolean value that determines whether this widget controls theresizing grid for its top-level window.This option is typically used in text widgets, where the informationin the widget has a natural size (the size of a character) and it makessense for the window's dimensions to be integral numbers of these units.These natural window sizes form a grid.If the <B>setGrid</B> option is set to true then the widget willcommunicate with the window manager so that when the user interactivelyresizes the top-level window that contains the widget, the dimensions ofthe window will be displayed to the user in grid units and the windowsize will be constrained to integral numbers of grid units.See the section GRIDDED GEOMETRY MANAGEMENT in the <B><A HREF="../TkCmd/wm.htm">wm</A></B> manualentry for more details.<P><DT>Command-Line Name: <B><A NAME="M-takefocus">-takefocus</A></B><DT>Database Name: <B>takeFocus</B><DT>Database Class: <B>TakeFocus</B><DD>Determines whether the window accepts the focus during keyboardtraversal (e.g., Tab and Shift-Tab).Before setting the focus to a window, the traversal scriptsconsult the value of the <B>takeFocus</B> option.A value of <B>0</B> means that the window should be skipped entirelyduring keyboard traversal. <B>1</B> means that the window should receive the inputfocus as long as it is viewable (it and all of its ancestors are mapped).An empty value for the option means that the traversal scripts makethe decision about whether or not to focus on the window: the currentalgorithm is to skip the window if it isdisabled, if it has no key bindings, or if it is not viewable.If the value has any other form, then the traversal scripts takethe value, append the name of the window to it (with a separator space),and evaluate the resulting string as a Tcl script.The script must return <B>0</B>, <B>1</B>, or an empty string: a <B>0</B> or <B>1</B> value specifies whether the window will receivethe input focus, and an empty string results in the default decisiondescribed above.Note: this interpretation of the option is defined entirely bythe Tcl scripts that implement traversal: the widget implementationsignore the option entirely, so you can change its meaning if youredefine the keyboard traversal scripts.<P><DT>Command-Line Name: <B><A NAME="M-text">-text</A></B><DT>Database Name: <B><A HREF="../TkCmd/text.htm">text</A></B><DT>Database Class: <B><A HREF="../TkCmd/text.htm">Text</A></B><DD>Specifies a string 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 <B>anchor</B> or <B>justify</B>.<P><DT>Command-Line Name: <B><A NAME="M-textvariable">-textvariable</A></B><DT>Database Name: <B>textVariable</B><DT>Database Class: <B><A HREF="../TclCmd/variable.htm">Variable</A></B><DD>Specifies the name of a variable. The value of the variable is a textstring to be displayed inside the widget; if the variable value changesthen the widget will automatically update itself to reflect the new value.The way in which the string is displayed in the widget depends on theparticular widget and may be determined by other options, such as<B>anchor</B> or <B>justify</B>.<P><DT>Command-Line Name: <B><A NAME="M-troughcolor">-troughcolor</A></B><DT>Database Name: <B>troughColor</B><DT>Database Class: <B>Background</B><DD>Specifies the color to use for the rectangular trough areasin widgets such as scrollbars and scales.<P><DT>Command-Line Name: <B><A NAME="M-underline">-underline</A></B><DT>Database Name: <B>underline</B><DT>Database Class: <B>Underline</B><DD>Specifies 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.<P><DT>Command-Line Name: <B><A NAME="M-wraplength">-wraplength</A></B><DT>Database Name: <B>wrapLength</B><DT>Database Class: <B>WrapLength</B><DD>For widgets that can perform word-wrapping, this option specifiesthe maximum line length.Lines that would exceed this length are wrapped onto the next line,so that no line is longer than the specified length.The value may be specified in any of the standard forms forscreen distances.If this value is less than or equal to 0 then no wrapping is done: lineswill break only at newline characters in the text.<P><DT>Command-Line Name: <B><A NAME="M-xscrollcommand">-xscrollcommand</A></B><DT>Database Name: <B>xScrollCommand</B><DT>Database Class: <B>ScrollCommand</B><DD>Specifies 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 Tcl command by concatenating the scroll command andtwo 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 Tcl interpreter for execution. Typically the<B>xScrollCommand</B> option consists of the path name of a scrollbarwidget followed by ``set'', e.g. ``.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.<P><DT>Command-Line Name: <B><A NAME="M-yscrollcommand">-yscrollcommand</A></B><DT>Database Name: <B>yScrollCommand</B><DT>Database Class: <B>ScrollCommand</B><DD>Specifies the prefix for a command used to communicate with verticalscrollbars. This option is treated in the same way as the<B>xScrollCommand</B> option, except that it is used for verticalscrollbars and is provided by widgets that support vertical scrolling.See the description of <B>xScrollCommand</B> for detailson how this option is used.</DL><H3><A NAME="M4">KEYWORDS</A></H3><A href="../Keywords/C.htm#class">class</A>, <A href="../Keywords/N.htm#name">name</A>, <A href="../Keywords/S.htm#standard option">standard option</A>, <A href="../Keywords/S.htm#switch">switch</A><HR><PRE><A HREF="../copyright.htm">Copyright</A> © 1990-1994 The Regents of the University of California.<A HREF="../copyright.htm">Copyright</A> © 1994-1996 Sun Microsystems, Inc.<A HREF="../copyright.htm">Copyright</A> © 1995-1997 Roger E. Critchlow Jr.</PRE></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -