[ Team LiB ] Previous Section Next Section

Entry and Spinbox Attributes

Table 34-3 lists the entry and spinbox widget attributes. The table lists the resource name, which has capitals at internal word boundaries. In Tcl commands these options are specified with a dash and are all lowercase.

Table 34-3. Entry and spinbox attribute resource names

activeBackground

Background color for active elements. Spinbox only. (Tk 8.4)

background

Background color (also bg).

borderWidth

Extra space around the edge of the text (also bd).

buttonBackground

Background color for up and down buttons. Spinbox only. (Tk 8.4)

command

Tcl script to invoke whenever a spinbutton is invoked. The script can include the percent substitutions as described in Table 34-1. Spinbox only. (Tk 8.4)

cursor

Cursor to display when mouse is over the widget.

disabledBackground

Background color when the widget is disabled. (Tk 8.4)

disabledForeground

Foreground color when the widget is disabled. (Tk 8.4)

exportSelection

If true, selected text is exported via the X selection mechanism.

font

Font for the text.

foreground

Foreground color (also fg).

format

Alternate format for spinbox numeric values, used only when -from and -to are specified. Must be of the form %<pad>.<pad>f, as used with the format command. Spinbox only. (Tk 8.4)

from

Floating-point value corresponding to the lowest value for a spinbox, used in conjunction with -to and -increment. Spinbox only. (Tk 8.4)

highlightBackground

Focus highlight color when widget does not have focus.

highlightColor

Focus highlight color when widget has focus.

highlightThickness

Thickness of focus highlight rectangle.

increment

Floating-point value specifying the increment. When used with -from and -to, the value in the widget will be adjusted by -increment when a spin button is pressed. Spinbox only. (Tk 8.4)

insertBackground

Background for area covered by insert cursor.

insertBorderWidth

Width of cursor border. Non-zero for 3D effect.

insertOffTime

Time, in milliseconds the insert cursor blinks off.

insertOnTime

Time, in milliseconds the insert cursor blinks on.

insertWidth

Width of insert cursor. Default is 2.

invalidCommand

Tcl script to execute when the -validatecommand script returns 0.

justify

Text justification: left, right, center.

readonlyBackground

Background color when the widget is read-only. (Tk 8.4)

relief

flat, sunken, raised, groove, solid or ridge.

repeatDelay

The number of milliseconds a spin button must be held down before it begins to auto-repeat. Spinbox only. (Tk 8.4)

repeatInterval

The number of milliseconds between auto-repeats. Spinbox only. (Tk 8.4)

selectBackground

Background color of selection.

selectForeground

Foreground color of selection.

selectBorderWidth

Width of selection border. Nonzero for 3D effect.

show

A character (e.g., *) to display instead of contents. Entry only.

state

State: normal, disabled (value unchangeable and non-responsive to user interaction) or readonly (value unchangeable, but the user can select and copy widget contents).

takeFocus

Controls focus changes from keyboard traversal.

textVariable

Name of Tcl variable whose value will be synchronized with the widget.

to

Floating-point value corresponding to the highest value for a spinbox, used in conjunction with -from and -increment. Spinbox only. (Tk 8.4)

validate

When validation should occur: none (default), focus, focusin, focusout, key, or all. (Tk 8.3)

validateCommand

Tcl script to execute to validate widget contents. Must return 1 if new widget value is valid or 0 if new widget value is invalid, in which case the widget contents don't change. (Tk 8.3)

values

List of spinbox values. Overrides any -from and -to settings. (Tk 8.4)

width

Width, in characters.

wrap

Boolean value. True causes the spinbox to wrap values of data in the widget. Default is False. Spinbox only. (Tk 8.4)

xScrollCommand

Connects entry to a scrollbar.

    [ Team LiB ] Previous Section Next Section