Movatterモバイル変換
[0]ホーム
- NAME
- options — Standard options supported by widgets
- DESCRIPTION
- -activebackground, activeBackground, Foreground
- -activeborderwidth, activeBorderWidth, BorderWidth
- -activeforeground, activeForeground, Background
- -anchor, anchor, Anchor
- -background or -bg, background, Background
- -bitmap, bitmap, Bitmap
- -borderwidth or -bd, borderWidth, BorderWidth
- -cursor, cursor, Cursor
- -compound, compound, Compound
- -disabledforeground, disabledForeground, DisabledForeground
- -exportselection, exportSelection, ExportSelection
- -font, font, Font
- -foreground or -fg, foreground, Foreground
- -highlightbackground, highlightBackground, HighlightBackground
- -highlightcolor, highlightColor, HighlightColor
- -highlightthickness, highlightThickness, HighlightThickness
- -image, image, Image
- -insertbackground, insertBackground, Foreground
- -insertborderwidth, insertBorderWidth, BorderWidth
- -insertofftime, insertOffTime, OffTime
- -insertontime, insertOnTime, OnTime
- -insertwidth, insertWidth, InsertWidth
- -jump, jump, Jump
- -justify, justify, Justify
- -orient, orient, Orient
- -padx, padX, Pad
- -pady, padY, Pad
- -relief, relief, Relief
- -repeatdelay, repeatDelay, RepeatDelay
- -repeatinterval, repeatInterval, RepeatInterval
- -selectbackground, selectBackground, Foreground
- -selectborderwidth, selectBorderWidth, BorderWidth
- -selectforeground, selectForeground, Background
- -setgrid, setGrid, SetGrid
- -takefocus, takeFocus, TakeFocus
- -text, text, Text
- -textvariable, textVariable, Variable
- -troughcolor, troughColor, Background
- -underline, underline, Underline
- -wraplength, wrapLength, WrapLength
- -xscrollcommand, xScrollCommand, ScrollCommand
- -yscrollcommand, yScrollCommand, ScrollCommand
- SEE ALSO
- KEYWORDS
options — Standard options supported by widgetsThis 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.In the descriptions below,“Command-Line Name”refers to theswitch used in class commands andconfigure widget commands toset this value. For example, if an option's command-line switch is-foreground and there exists a widget.a.b.c, then thecommand
.a.b.c configure -foreground black
may be used to specify the valueblack for the option inthe widget.a.b.c. Command-line switches may be abbreviated,as long as the abbreviation is unambiguous.“Database Name”refers to the option's name in the option database (e.g. in .Xdefaults files).“Database Class”refers to the option's class value in the option database.- Command-Line Name:-activebackground
- Database Name:activeBackground
- Database Class:Foreground
- Specifies background color 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.If strict Motif compliance has been requested by setting thetk_strictMotif variable, this option will normally beignored; the normal background color will be used instead.For some elements on Windows and Macintosh systems, the active colorwill only be used while mouse button 1 is pressed over the element.
- Command-Line Name:-activeborderwidth
- Database Name:activeBorderWidth
- Database Class:BorderWidth
- Specifies a non-negative value indicatingthe width of the 3-D border drawn around active elements. See above fordefinition of active elements.The value may have any of the forms acceptable toTk_GetPixels.This option is typically only available in widgets displaying morethan one element at a time (e.g. menus but not buttons).
- Command-Line Name:-activeforeground
- Database Name:activeForeground
- Database Class:Background
- Specifies foreground color to use when drawing active elements.See above for definition of active elements.
- Command-Line Name:-anchor
- Database Name:anchor
- Database Class:Anchor
- Specifies how the information in a widget (e.g. text or a bitmap)is to be displayed in the widget.Must be one of the valuesn,ne,e,se,s,sw,w,nw, orcenter.For example,nw means display the information such that itstop-left corner is at the top-left corner of the widget.
- Command-Line Name:-background or -bg
- Database Name:background
- Database Class:Background
- Specifies the normal background color to use when displaying thewidget.
- Command-Line Name:-bitmap
- Database Name:bitmap
- Database Class:Bitmap
- Specifies a bitmap to display in the widget, in any of the formsacceptable toTk_GetBitmap.The exact way in which the bitmap is displayed may be affected byother options such as-anchor or-justify.Typically, if this option is specified then it overrides otheroptions that specify a textual value to display in the widgetbut this is controlled by the-compound option;the-bitmap option may be reset to an empty string to re-enablea text display.In widgets that support both-bitmap and-image options,-image will usually override-bitmap.
- Command-Line Name:-borderwidth or -bd
- Database Name:borderWidth
- Database Class:BorderWidth
- Specifies 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-relief option typically determinesthis). The value may also be used when drawing 3-D effects in theinterior of the widget.The value may have any of the forms acceptable toTk_GetPixels.
- Command-Line Name:-cursor
- Database Name:cursor
- Database Class:Cursor
- Specifies the mouse cursor to be used for the widget.The value may have any of the forms acceptable toTk_GetCursor.In addition, if an empty string is specified, it indicates that thewidget should defer to its parent for cursor specification.
- Command-Line Name:-compound
- Database Name:compound
- Database Class:Compound
- Specifies if the widget should display text and bitmaps/images at thesame time, and if so, where the bitmap/image should be placed relativeto the text. Must be one of the valuesnone,bottom,top,left,right, orcenter. For example, the(default) valuenone specifies that the bitmap or image should(if defined) be displayed instead of the text, the valueleftspecifies that the bitmap or image should be displayed to the left ofthe text, and the valuecenter specifies that the bitmap orimage should be displayed on top of the text.
- Command-Line Name:-disabledforeground
- Database Name:disabledForeground
- Database Class:DisabledForeground
- Specifies foreground color to use when drawing a disabled element.If the option is specified as an empty string (which is typically thecase on monochrome displays), disabled elements are drawn with thenormal foreground color but they are dimmed by drawing themwith a stippled fill pattern.
- Command-Line Name:-exportselection
- Database Name:exportSelection
- Database Class:ExportSelection
- Specifies whether or not a selection in the widget should also bethe X selection.The value may have any of the forms accepted byTcl_GetBoolean,such astrue,false,0,1,yes, orno.If the selection is exported, then selecting in the widget deselectsthe current X selection, selecting outside the widget deselects anywidget selection, and the widget will respond to selection retrievalrequests when it has a selection. The default is usually for widgetsto export selections.
- Command-Line Name:-font
- Database Name:font
- Database Class:Font
- Specifies the font to use when drawing text inside the widget.The value may have any of the forms described in thefont manualpage underFONT DESCRIPTION.
- Command-Line Name:-foreground or -fg
- Database Name:foreground
- Database Class:Foreground
- Specifies the normal foreground color to use when displaying the widget.
- Command-Line Name:-highlightbackground
- Database Name:highlightBackground
- Database Class:HighlightBackground
- Specifies the color to display in the traversal highlight region whenthe widget does not have the input focus.
- Command-Line Name:-highlightcolor
- Database Name:highlightColor
- Database Class:HighlightColor
- Specifies the color to use for the traversal highlight rectangle that isdrawn around the widget when it has the input focus.
- Command-Line Name:-highlightthickness
- Database Name:highlightThickness
- Database Class:HighlightThickness
- Specifies a non-negative value indicating the width of the highlightrectangle to draw around the outside of the widget when it has theinput focus.The value may have any of the forms acceptable toTk_GetPixels.If the value is zero, no focus highlight is drawn around the widget.
- Command-Line Name:-image
- Database Name:image
- Database Class:Image
- Specifies an image to display in the widget, which must have beencreated with theimage create command.Typically, if the-image option is specified then it overrides otheroptions that specify a bitmap or textual value to display in thewidget, though this is controlled by the-compound option;the-image option may be reset to an empty string to re-enablea bitmap or text display.
- Command-Line Name:-insertbackground
- Database Name:insertBackground
- Database Class:Foreground
- Specifies the color to use as background in the area covered by theinsertion cursor. This color will normally override either the normalbackground for the widget (or the selection background if the insertioncursor happens to fall in the selection).
- Command-Line Name:-insertborderwidth
- Database Name:insertBorderWidth
- Database Class:BorderWidth
- Specifies a non-negative value indicating the widthof the 3-D border to draw around the insertion cursor.The value may have any of the forms acceptable toTk_GetPixels.
- Command-Line Name:-insertofftime
- Database Name:insertOffTime
- Database Class:OffTime
- Specifies a non-negative integer value indicating the number ofmilliseconds the insertion cursor should remain“off”in each blink cycle.If this option is zero then the cursor does not blink: it is onall the time.
- Command-Line Name:-insertontime
- Database Name:insertOnTime
- Database Class:OnTime
- Specifies a non-negative integer value indicating the number ofmilliseconds the insertion cursor should remain“on”in each blink cycle.
- Command-Line Name:-insertwidth
- Database Name:insertWidth
- Database Class:InsertWidth
- Specifies a non-negative value indicating the total width of the insertion cursor.The value may have any of the forms acceptable toTk_GetPixels.If a border has been specified for the insertioncursor (using the-insertborderwidth option), the borderwill be drawn inside the width specified by the-insertwidthoption.
- Command-Line Name:-jump
- Database Name:jump
- Database Class:Jump
- 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 byTcl_GetBoolean.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).
- Command-Line Name:-justify
- Database Name:justify
- Database Class:Justify
- When there are multiple lines of text displayed in a widget, thisoption determines how the lines line up with each other.Must be one ofleft,center, orright.Left means that the lines' left edges all line up,centermeans that the lines' centers are aligned, andright meansthat the lines' right edges line up.
- Command-Line Name:-orient
- Database Name:orient
- Database Class:Orient
- 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 eitherhorizontalorvertical or an abbreviation of one of these.
- Command-Line Name:-padx
- Database Name:padX
- Database Class:Pad
- 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 toTk_GetPixels.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.
- Command-Line Name:-pady
- Database Name:padY
- Database Class:Pad
- 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 toTk_GetPixels.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.
- Command-Line Name:-relief
- Database Name:relief
- Database Class:Relief
- Specifies the 3-D effect desired for the widget. Acceptablevalues areraised,sunken,flat,ridge,solid, andgroove.The valueindicates how the interior of the widget should appear relativeto its exterior; for example,raised means the interior ofthe widget should appear to protrude from the screen, relative tothe exterior of the widget.
- Command-Line Name:-repeatdelay
- Database Name:repeatDelay
- Database Class:RepeatDelay
- 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.
- Command-Line Name:-repeatinterval
- Database Name:repeatInterval
- Database Class:RepeatInterval
- Used in conjunction with-repeatdelay: once auto-repeatbegins, this option determines the number of milliseconds betweenauto-repeats.
- Command-Line Name:-selectbackground
- Database Name:selectBackground
- Database Class:Foreground
- Specifies the background color to use when displaying selecteditems.
- Command-Line Name:-selectborderwidth
- Database Name:selectBorderWidth
- Database Class:BorderWidth
- 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 toTk_GetPixels.
- Command-Line Name:-selectforeground
- Database Name:selectForeground
- Database Class:Background
- Specifies the foreground color to use when displaying selecteditems.
- Command-Line Name:-setgrid
- Database Name:setGrid
- Database Class:SetGrid
- 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-setgrid 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 sectionGRIDDED GEOMETRY MANAGEMENT in thewm manualentry for more details.
- Command-Line Name:-takefocus
- Database Name:takeFocus
- Database Class:TakeFocus
- 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-takefocus option.A value of0 means that the window should be skipped entirelyduring keyboard traversal.1 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 return0,1, or an empty string: a0 or1 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.
- Command-Line Name:-text
- Database Name:text
- Database Class:Text
- 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-anchor or-justify.
- Command-Line Name:-textvariable
- Database Name:textVariable
- Database Class:Variable
- Specifies the name of a global 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-anchor or-justify.
- Command-Line Name:-troughcolor
- Database Name:troughColor
- Database Class:Background
- Specifies the color to use for the rectangular trough areasin widgets such as scrollbars and scales. This option is ignored forscrollbars on Windows (native widget does not recognize this option).
- Command-Line Name:-underline
- Database Name:underline
- Database Class:Underline
- 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.
- Command-Line Name:-wraplength
- Database Name:wrapLength
- Database Class:WrapLength
- 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.
- Command-Line Name:-xscrollcommand
- Database Name:xScrollCommand
- Database Class:ScrollCommand
- 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-xscrollcommand 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.
- Command-Line Name:-yscrollcommand
- Database Name:yScrollCommand
- Database Class:ScrollCommand
- Specifies the prefix for a command used to communicate with verticalscrollbars. This option is treated in the same way as the-xscrollcommand option, except that it is used for verticalscrollbars and is provided by widgets that support vertical scrolling.See the description of-xscrollcommand for detailson how this option is used.
colors,cursors,fontclass,name,standard option,switchCopyright © 1990-1994 The Regents of the University of California.
Copyright © 1994-1996 Sun Microsystems, Inc.
[8]ページ先頭