All widget are created with
widgetpathname [ option1value1 [ option2 ... ] ]
where widget is the Tcl command corresponding to the class of
widget desired (eg. button
) and pathname is a string which
will be used to identify the newly created widget. In general,
a widget name is the concatenation of its parent`s name followed
by a period (unless the parent is the root window ``.``) and a
string containing no periods (eg. .mainframe.btnframe.btn1).
Widget configuration options may be passed in the creation
command. Options begin with a ``-`` and are always followed
by a value string. After creation, options may be changed using
the configure
widget command
pathnameconfigureoption1value1 [ option2 ... ]
and queried using the cget
command
pathnamecgetoption
Some of the widget options which multiple widgets support are described
here for brevity. For options that take screen units, values are in
pixels unless an optional one letter suffix modifier is present ---
c (cm), i (inch), m (mm), or p (points).
-activebackground color
Background color of widget when it is active.
-activeborderwidth width
Width in screen units of widget border when it is active.
-activeforeground color
Foreground color of widget when it is active.
-anchor anchorPos
How information is positioned inside widget. Valid
anchorPos values are n, ne, e, se, s, sw, w, nw, and center.
-background color
Background color of widget in normal state (Abbrev: -bg).
-bitmap bitmap
Bitmap to display in the widget (error, gray12, gray25, gray50,
gray75, hourglass, info, questhead, question, warning, @
filename).
-borderwidth width
Width in screen units of widget border in normal state (Abbrev: -bd).
-command tclCommand
Tcl command to run when widget is invoked.
-cursor cursor
Cursor to display when mouse pointer is in widget.
-disabledforeground color
Foreground color of widget when it is disabled.
-exportselection boolean
Whether or not a selection in the widget should also
be the X selection.
-font font
Font to use when drawing text inside the widget.
-foreground color
Foreground color of widget in normal state (Abbrev: -fg).
-height widthtextChars
Height of widget. Units depend on widget.
-highlightbackground color
Color of the rectangle drawn around the widget when it does not
have the input focus.
-highlightcolor color
Color of the rectangle drawn around the widget when it has the
input focus.
-highlightthickness width
Width in screen units of highlight rectangle drawn around widget
when it has the input focus.
-image image
Image to display in the widget (see Images).
-insertbackground color
Color to use as background in the area covered by the insertion
cursor.
-insertborderwidth width
Width in screen units of border to draw around the insertion cursor.
-insertofftime milliseconds
Time the insertion cursor should remain ``off`` in each blink cycle.
-insertontime milliseconds
Time the insertion cursor should remain ``on`` in each blink cycle.
-insertwidth width
Width in screen units of the insertion cursor.
-jump boolean
Whether to notify scrollbars and scales connected
to the widget to delay updates until mouse button is released.
-justify leftcenter
ight
How multiple lines line up with each other.
-orient horizontalvertical
Which orientation widget should use in layout.
-padx width
Extra space in screen units to request for the widget in X-direction.
-pady height
Extra space in screen units to request for the widget in Y-direction.
-relief flatgroove
aised
idgesunken
3-D effect desired for the widget`s border.
-repeatdelay milliseconds
Time a button or key must be held down before it begins to
auto-repeat.
-repeatinterval milliseconds
Time between auto-repeats once action has begun.
-selectbackground color
Background color to use when displaying selected items.
-selectborderwidth width
Width in screen units of border to draw around selected items.
-selectforeground color
Foreground color to use when displaying selected items.
-setgrid boolean
Whether this widget controls the resizing grid for its
toplevel window.
-state normaldisabled (active for button-type widgets)
Current state of widget.
-takefocus focusType
If 0 or 1, signals that the widget should never or always take the focus.
If empty, Tk decides. Otherwise, evaluates argument as script with widget
name appended as argument. Returned value must be 0, 1 or empty.
-text string
Text to be displayed inside the widget.
-textvariable variable
Variable which contains a text string to be displayed inside the widget.
-troughcolor color
Color to use for the rectangular trough areas in widget.
-underline index
Integer index of a character to underline in the widget.
-width widthtextChars
Width of widget. Units depend on widget.
-wraplength length
Maximum line length in screen units for word-wrapping.
-xscrollcommand cmdPrefix
Prefix for a command used to communicate with horizontal scrollbars.
-yscrollcommand cmdPrefix
Prefix for a command used to communicate with vertical scrollbars.