GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  TK::OPTIONS (3)

.ds Aq ’

NAME

Tk::options - Standard options supported by widgets and their manipulation

CONTENTS

SYNOPSIS

$value = $widget-><B>cgetB>(’-option’);

$widget-><B>configureB>(-option=>value ?,-option=>value ...?);

@list = $widget-><B>configureB>(’-option’);

@lol = $widget-><B>configureB>;

DESCRIPTION

All widgets, and images have a standard mechanism for setting and querying attibutes or options. The mechanism is based on two methods <B>configureB> and <B>cgetB>. The behaviour of these methods is as follows:
$widget-><B>configureB>(-option=>value ?,-option=>value ...?); Sets the values of -option to value for each -option=>value pair. The internal <B>newB> method does an implicit <B>configureB> in this form with options passed in at widget create time.
$widget-><B>configureB>(’-option’) In array context returns a list of five or two elements. If -option is an alias for another options it return a list consisting of the alias option and the name for the option is is an alias for, e.g., (-bg, background). If -option is not an alias the returned list has the following five elements:
Option Name The value of -option, e.g., <B>-backgroundB>.
Name The option’s name in the option database, e.g., background.
Class The option’s class value in the option database, e.g., Background.
Default The default value for the option if not specified or in the option database, e.g., grey.
Value The current value (as returned by <B>cgetB>), e.g., white.
$widget-><B>configureB> Returns a list of lists for all the options supported by $widget. Each sub-list is in the form returned by <B>configureB>(’-option’). (This mechanism is used by the <B>Tk::DerivedB> class to determine the options available from base class.)
$widget-><B>cgetB>(’-option’) Returns the current value of -option for $widget.

<B>cgetB>(’-option’) is clumsy with the need for <B>’’B> due to perl’s parsing rules. Something more subtle using tie might look better.

The following paragraphs describe the common configuration options supported by widgets in the Tk toolkit. Every widget does not necessarily support every option (see the the documentation entries for individual widgets for a list of the standard options supported by that widget), but if a widget does support an option with one of the names listed below, then the option has exactly the effect described below.

In the descriptions below, ‘‘Name’’ refers to the option’s name in the option database. ‘‘Class’’ refers to the option’s class value in the option database. ‘‘Switch’’ refers to the switch used in widget-creation and <B>configureB> widget methods to set this value. For example, if an option’s configure option is <B>-foregroundB> and there exists a widget $widget, then the call:

$widget-><B>configureB>(<B>-foregroundB>=><B>’black’B>)

may be used to specify the value <B>blackB> for the option in the widget $widget. Configure options may be abbreviated, as long as the abbreviation is unambiguous (abbreviation is deprecated in perl/Tk).

    Creation options: Widget Name and Class

The <B>NameB> and <B>-classB> options can only be specified when a widget is created, and cannot be changed with <B>configureB>. These options determine the widget’s identity and how Tk applies resource values from the option database (see Tk::option) and so they cannot be assigned by the options database.
Name:  name
Switch:        <B>NameB> Specifies the path element for the widget. Names generally begin with a lowercase letter.

Each widget has a unique pathname that follows the hierarchy from the <B>MainWindowB> to the widget itself. Since the widget’s <B>PathNameB> is used to assign options from the options database, it is important to specify a distinctive <B>NameB> for any widget that will have non-default options. See Tk::option for details.

Name:  class
Switch:        <B>-classB> Specifies a class for the window. Classes generally begin with an uppercase letter.

This class will be used when querying the option database for the window’s other options (see Tk::options), and it will also be used later for other purposes such as bindings. One typically assigns a class to a <B>TopLevelB> or <B>FrameB> so that the class will apply to all of that widget’s children.

    Reconfigurable options

These options can be set at widget creation or changed later via <B>configureB>.
Name:  <B>activeBackgroundB>
Class: <B>ForegroundB>
Switch:        <B>-activebackgroundB> Specifies background color to use when drawing active elements. An element (a widget or portion of a widget) is active if the mouse cursor is positioned over the element and pressing a mouse button will cause some action to occur. If strict Motif compliance has been requested by setting the <B>B>$Tk::strictMotif<B>B> variable, this option will normally be ignored; the normal background color will be used instead. For some elements on Windows and Macintosh systems, the active color will only be used while mouse button 1 is pressed over the element.
Name:  <B>activeBorderWidthB>
Class: <B>BorderWidthB>
Switch:        <B>-activeborderwidthB> Specifies a non-negative value indicating the width of the 3-D border drawn around active elements. See above for definition of active elements. The value may have any of the forms acceptable to <B>Tk_GetPixelsB>. This option is typically only available in widgets displaying more than one element at a time (e.g. menus but not buttons).
Name:  <B>activeForegroundB>
Class: <B>BackgroundB>
Switch:        <B>-activeforegroundB> Specifies foreground color to use when drawing active elements. See above for definition of active elements.
Name:  <B>activetileB>
Class: <B>TileB>
Switch:        <B>-activetileB> Specifies image used to display inside active elements of the widget. See above for definition of active elements.
Name:  <B>anchorB>
Class: <B>AnchorB>
Switch:        <B>-anchorB> 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 values <B>nB>, <B>neB>, <B>eB>, <B>seB>, <B>sB>, <B>swB>, <B>wB>, <B>nwB>, or <B>centerB>. For example, <B>nwB> means display the information such that its top-left corner is at the top-left corner of the widget.
Name:  <B>backgroundB>
Class: <B>BackgroundB>
Switch:        <B>-backgroundB>
Alias: <B>-bgB> Specifies the normal background color to use when displaying the widget.
Name:  <B>bitmapB>
Class: <B>BitmapB>
Switch:        <B>-bitmapB> Specifies a bitmap to display in the widget, in any of the forms acceptable to <B>Tk_GetBitmapB>. The exact way in which the bitmap is displayed may be affected by other options such as <B>-anchorB> or <B>-justifyB>. Typically, if this option is specified then it overrides other options that specify a textual value to display in the widget; the <B>-bitmapB> option may be reset to an empty string to re-enable a text display. In widgets that support both <B>-bitmapB> and <B>-imageB> options, <B>-imageB> will usually override <B>-bitmapB>.
Name:  <B>borderWidthB>
Class: <B>BorderWidthB>
Switch:        <B>-borderwidthB>
Alias: <B>-bdB> Specifies a non-negative value indicating the width of the 3-D border to draw around the outside of the widget (if such a border is being drawn; the <B>reliefB> option typically determines this). The value may also be used when drawing 3-D effects in the interior of the widget. The value may have any of the forms acceptable to <B>Tk_GetPixelsB>.
Name:  <B>compoundB>
Class: <B>CompoundB>
Switch:        <B>-compoundB> Specifies if the widget should display text and bitmaps/images at the same time, and if so, where the bitmap/image should be placed relative to the text. Must be one of the values <B>noneB>, <B>bottomB>, <B>topB>, <B>leftB>, <B>rightB>, or <B>centerB>. For example, the (default) value <B>noneB> specifies that the bitmap or image should (if defined) be displayed instead of the text, the value <B>leftB> specifies that the bitmap or image should be displayed to the left of the text, and the value <B>centerB> specifies that the bitmap or image should be displayed on top of the text.
Name:  <B>cursorB>
Class: <B>CursorB>
Switch:        <B>-cursorB> Specifies the mouse cursor to be used for the widget. The value may have any of the forms acceptable to <B>Tk_GetCursorB>.
Name:  <B>dashB>
Class: <B>DashB>
Switch:        <B>-dashB> The value may have any of the forms accepted by <B>Tk_GetDashB>, such as <B>4B>, <B>[6,4]B>, <B>.B>, <B>-B>, <B>-.B>, or <B>-..B>.
Name:  <B>dashoffsetB>
Class: <B>DashoffsetB>
Switch:        <B>-dashoffsetB> Specifies the offset in the dash list where the drawing starts.
Name:  <B>disabledForegroundB>
Class: <B>DisabledForegroundB>
Switch:        <B>-disabledforegroundB> Specifies foreground color to use when drawing a disabled element. If the option is specified as an empty string (which is typically the case on monochrome displays), disabled elements are drawn with the normal foreground color but they are dimmed by drawing them with a stippled fill pattern.
Name:  <B>disabledtileB>
Class: <B>TileB>
Switch:        <B>-disabledtileB> Specifies image to use when drawing a disabled element.
Name:  <B>exportSelectionB>
Class: <B>ExportSelectionB>
Switch:        <B>-exportselectionB> Specifies whether or not a selection in the widget should also be the X selection. The value may have any of the forms accepted by <B>Tcl_GetBooleanB>, such as <B>trueB>, <B>falseB>, <B>0B>, <B>1B>, <B>yesB>, or <B>noB>. If the selection is exported, then selecting in the widget deselects the current X selection, selecting outside the widget deselects any widget selection, and the widget will respond to selection retrieval requests when it has a selection. The default is usually for widgets to export selections.
Name:  <B>fontB>
Class: <B>FontB>
Switch:        <B>-fontB> Specifies the font to use when drawing text inside the widget.
Name:  <B>foregroundB>
Class: <B>ForegroundB>
Switch:        <B>-foregroundB>
Alias: <B>-fgB> Specifies the normal foreground color to use when displaying the widget.
Name:  <B>highlightBackgroundB>
Class: <B>HighlightBackgroundB>
Switch:        <B>-highlightbackgroundB> Specifies the color to display in the traversal highlight region when the widget does not have the input focus.
Name:  <B>highlightColorB>
Class: <B>HighlightColorB>
Switch:        <B>-highlightcolorB> Specifies the color to use for the traversal highlight rectangle that is drawn around the widget when it has the input focus.
Name:  <B>highlightThicknessB>
Class: <B>HighlightThicknessB>
Switch:        <B>-highlightthicknessB> Specifies a non-negative value indicating the width of the highlight rectangle to draw around the outside of the widget when it has the input focus. The value may have any of the forms acceptable to <B>Tk_GetPixelsB>. If the value is zero, no focus highlight is drawn around the widget.
Name:  <B>imageB>
Class: <B>ImageB>
Switch:        <B>-imageB> Specifies an image to display in the widget, which must have been created with an image create. (See Tk::Image for details of image creation.) Typically, if the <B>-imageB> option is specified then it overrides other options that specify a bitmap or textual value to display in the widget; the <B>-imageB> option may be reset to an empty string to re-enable a bitmap or text display.
Name:  <B>insertBackgroundB>
Class: <B>ForegroundB>
Switch:        <B>-insertbackgroundB> Specifies the color to use as background in the area covered by the insertion cursor. This color will normally override either the normal background for the widget (or the selection background if the insertion cursor happens to fall in the selection).
Name:  <B>insertBorderWidthB>
Class: <B>BorderWidthB>
Switch:        <B>-insertborderwidthB> Specifies a non-negative value indicating the width of the 3-D border to draw around the insertion cursor. The value may have any of the forms acceptable to <B>Tk_GetPixelsB>.
Name:  <B>insertOffTimeB>
Class: <B>OffTimeB>
Switch:        <B>-insertofftimeB> Specifies a non-negative integer value indicating the number of milliseconds the insertion cursor should remain ‘‘off’’ in each blink cycle. If this option is zero then the cursor doesn’t blink: it is on all the time.
Name:  <B>insertOnTimeB>
Class: <B>OnTimeB>
Switch:        <B>-insertontimeB> Specifies a non-negative integer value indicating the number of milliseconds the insertion cursor should remain ‘‘on’’ in each blink cycle.
Name:  <B>insertWidthB>
Class: <B>InsertWidthB>
Switch:        <B>-insertwidthB> Specifies a value indicating the total width of the insertion cursor. The value may have any of the forms acceptable to <B>Tk_GetPixelsB>. If a border has been specified for the insertion cursor (using the <B>insertBorderWidthB> option), the border will be drawn inside the width specified by the <B>insertWidthB> option.
Name:  <B>jumpB>
Class: <B>JumpB>
Switch:        <B>-jumpB> For widgets with a slider that can be dragged to adjust a value, such as scrollbars, this option determines when notifications are made about changes in the value. The option’s value must be a boolean of the form accepted by <B>Tcl_GetBooleanB>. If the value is false, updates are made continuously as the slider is dragged. If the value is true, updates are delayed until the mouse button is released to end the drag; at that point a single notification is made (the value ‘‘jumps’’ rather than changing smoothly).
Name:  <B>justifyB>
Class: <B>JustifyB>
Switch:        <B>-justifyB> When there are multiple lines of text displayed in a widget, this option determines how the lines line up with each other. Must be one of <B>leftB>, <B>centerB>, or <B>rightB>. <B>LeftB> means that the lines’ left edges all line up, <B>centerB> means that the lines’ centers are aligned, and <B>rightB> means that the lines’ right edges line up.
Name:  <B>offsetB>
Class: <B>OffsetB>
Switch:        <B>-offsetB> Specifies the offset of tiles (see also <B>-tileB> option). It can have two different formats <B>-offset x,yB> or <B>-offset sideB>, where side can be <B>nB>, <B>neB>, <B>eB>, <B>seB>, <B>sB>, <B>swB>, <B>wB>, <B>nwB>, or <B>centerB>. In the first case the origin is the origin of the toplevel of the current window. For the canvas itself and canvas objects the origin is the canvas origin, but putting <B>#B> in front of the coordinate pair indicates using the toplevel origin in stead. For canvas objects, the <B>-offsetB> option is used for stippling as well. For the line and polygon canvas items you can also specify an index as argument, which connects the stipple or tile origin to one of the coordinate points of the line/polygon.
Name:  <B>orientB>
Class: <B>OrientB>
Switch:        <B>-orientB> For widgets that can lay themselves out with either a horizontal or vertical orientation, such as scrollbars, this option specifies which orientation should be used. Must be either <B>horizontalB> or <B>verticalB> or an abbreviation of one of these.
Name:  <B>padXB>
Class: <B>PadB>
Switch:        <B>-padxB> Specifies a non-negative value indicating how much extra space to request for the widget in the X-direction. The value may have any of the forms acceptable to <B>Tk_GetPixelsB>. When computing how large a window it needs, the widget will add this amount to the width it would normally need (as determined by the width of the things displayed in the widget); if the geometry manager can satisfy this request, the widget will end up with extra internal space to the left and/or right of what it displays inside. Most widgets only use this option for padding text: if they are displaying a bitmap or image, then they usually ignore padding options.
Name:  <B>padYB>
Class: <B>PadB>
Switch:        <B>-padyB> Specifies a non-negative value indicating how much extra space to request for the widget in the Y-direction. The value may have any of the forms acceptable to <B>Tk_GetPixelsB>. When computing how large a window it needs, the widget will add this amount to the height it would normally need (as determined by the height of the things displayed in the widget); if the geometry manager can satisfy this request, the widget will end up with extra internal space above and/or below what it displays inside. Most widgets only use this option for padding text: if they are displaying a bitmap or image, then they usually ignore padding options.
Name:  <B>reliefB>
Class: <B>ReliefB>
Switch:        <B>-reliefB> Specifies the 3-D effect desired for the widget. Acceptable values are <B>raisedB>, <B>sunkenB>, <B>flatB>, <B>ridgeB>, <B>solidB>, and <B>grooveB>. The value indicates how the interior of the widget should appear relative to its exterior; for example, <B>raisedB> means the interior of the widget should appear to protrude from the screen, relative to the exterior of the widget.
Name:  <B>repeatDelayB>
Class: <B>RepeatDelayB>
Switch:        <B>-repeatdelayB> Specifies the number of milliseconds a button or key must be held down before it begins to auto-repeat. Used, for example, on the up- and down-arrows in scrollbars.
Name:  <B>repeatIntervalB>
Class: <B>RepeatIntervalB>
Switch:        <B>-repeatintervalB> Used in conjunction with <B>repeatDelayB>: once auto-repeat begins, this option determines the number of milliseconds between auto-repeats.
Name:  <B>selectBackgroundB>
Class: <B>ForegroundB>
Switch:        <B>-selectbackgroundB> Specifies the background color to use when displaying selected items.
Name:  <B>selectBorderWidthB>
Class: <B>BorderWidthB>
Switch:        <B>-selectborderwidthB> Specifies a non-negative value indicating the width of the 3-D border to draw around selected items. The value may have any of the forms acceptable to <B>Tk_GetPixelsB>.
Name:  <B>selectForegroundB>
Class: <B>BackgroundB>
Switch:        <B>-selectforegroundB> Specifies the foreground color to use when displaying selected items.
Name:  <B>setGridB>
Class: <B>SetGridB>
Switch:        <B>-setgridB> Specifies a boolean value that determines whether this widget controls the resizing grid for its top-level window. This option is typically used in text widgets, where the information in the widget has a natural size (the size of a character) and it makes sense for the window’s dimensions to be integral numbers of these units. These natural window sizes form a grid. If the <B>setGridB> option is set to true then the widget will communicate with the window manager so that when the user interactively resizes the top-level window that contains the widget, the dimensions of the window will be displayed to the user in grid units and the window size will be constrained to integral numbers of grid units. See GRIDDED GEOMETRY MANAGEMENT in Tk::Wm for more details.
Name:  <B>takeFocusB>
Class: <B>TakeFocusB>
Switch:        <B>-takefocusB> Determines whether the window accepts the focus during keyboard traversal (e.g., Tab and Shift-Tab). Before setting the focus to a window, the traversal scripts consult the value of the <B>takeFocusB> option. A value of <B>0B> means that the window should be skipped entirely during keyboard traversal. <B>1B> means that the window should receive the input focus 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 make the decision about whether or not to focus on the window: the current algorithm is to skip the window if it is disabled, if it has no key bindings, or if it is not viewable. If the value has any other form, then the traversal scripts take the value, append the name of the window to it (with a separator space), and evaluate the resulting string as a Callback. The script must return <B>0B>, <B>1B>, or an empty string: a <B>0B> or <B>1B> value specifies whether the window will receive the input focus, and an empty string results in the default decision described above. Note: this interpretation of the option is defined entirely by the Callbacks that implement traversal: the widget implementations ignore the option entirely, so you can change its meaning if you redefine the keyboard traversal scripts.
Name:  <B>textB>
Class: <B>TextB>
Switch:        <B>-textB> Specifies a string to be displayed inside the widget. The way in which the string is displayed depends on the particular widget and may be determined by other options, such as <B>anchorB> or <B>justifyB>.
Name:  <B>textVariableB>
Class: <B>VariableB>
Switch:        <B>-textvariableB> Specifies the name of a variable. The value of the variable is a text string to be displayed inside the widget; if the variable value changes then the widget will automatically update itself to reflect the new value. The way in which the string is displayed in the widget depends on the particular widget and may be determined by other options, such as <B>anchorB> or <B>justifyB>.
Name:  <B>tileB>
Class: <B>TileB>
Switch:        <B>-tileB> Specifies image used to display the widget. If image is the empty string, then the normal background color is displayed.
Name:  <B>troughColorB>
Class: <B>BackgroundB>
Switch:        <B>-troughcolorB> Specifies the color to use for the rectangular trough areas in widgets such as scrollbars and scales.
Name:  <B>troughTileB>
Class: <B>TileB>
Switch:        <B>-troughtileB> Specifies image used to display in the rectangular trough areas in widgets such as scrollbars and scales.
Name:  <B>underlineB>
Class: <B>UnderlineB>
Switch:        <B>-underlineB> Specifies the integer index of a character to underline in the widget. This option is used by the default bindings to implement keyboard traversal for menu buttons and menu entries. 0 corresponds to the first character of the text displayed in the widget, 1 to the next character, and so on.
Name:  <B>wrapLengthB>
Class: <B>WrapLengthB>
Switch:        <B>-wraplengthB> For widgets that can perform word-wrapping, this option specifies the 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 for screen distances. If this value is less than or equal to 0 then no wrapping is done: lines will break only at newline characters in the text.
Name:  <B>xScrollCommandB>
Class: <B>ScrollCommandB>
Switch:        <B>-xscrollcommandB> Specifies a callback used to communicate with horizontal scrollbars. When the view in the widget’s window changes (or whenever anything else occurs that could change the display in a scrollbar, such as a change in the total size of the widget’s contents), the widget will make a callback passing two numeric arguments in addition to any specified in the callback. Each of the numbers is a fraction between 0 and 1, which indicates a position in the document. 0 indicates the beginning of the document, 1 indicates the end, .333 indicates a position one third the way through the document, and so on. The first fraction indicates the first information in the document that is visible in the window, and the second fraction indicates the information just after the last portion that is visible. Typically the <B>xScrollCommandB> option consists of the scrollbar widget object and the method ‘‘set’’ i.e. [<B>setB> => $sb]: this will cause the scrollbar to be updated whenever the view in the window changes. If this option is not specified, then no command will be executed.
Name:  <B>yScrollCommandB>
Class: <B>ScrollCommandB>
Switch:        <B>-yscrollcommandB> Specifies a calback used to communicate with vertical scrollbars. This option is treated in the same way as the <B>xScrollCommandB> option, except that it is used for vertical scrollbars and is provided by widgets that support vertical scrolling. See the description of <B>xScrollCommandB> for details on how this option is used.

SEE ALSO

Tk::option Tk::callbacks Tk::ConfigSpecs Tk_GetPixels

KEYWORDS

class, name, standard option, switch
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 OPTIONS (3) 2013-11-15

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.