-- ! SpecTcl, by S. A. Uhler --
-- Copyright (c) 1994-1995 Sun Microsystems, Inc. --
-- See the file "license.txt" for information on usage and redistribution
-- of this file, and for a DISCLAIMER OF ALL WARRANTIES.
-->
Widget options
Widget options
Widget options in SpecTcl can be configured from the widgets option sheet.
The option sheet contains not only the widget options, but options for
geometry layout as well. This page describes only those widget options
that are different than the options that would be used in an
widget configure
command, and described in the Tk man pages.
There are cases where the name of a widget option (such as padx
)
conflicts with the name of a geometry management option. In those cases,
one of the options is renamed to prevent ambiguity. Consequently, the option
name used in the actual generated Tcl code will not match the name on the
corresponding option sheet.
- align (widget)
- This option specifies which side of its cavity the widget is connected to.
The valid options are n, ne, e, se, s, sw. w. nw, or c. In the generated
Tcl code, this option is turned into the anchor option of the table
geometry manager.
- comments
- This is arbitrary text. It is not currently used for anything.
- command
- The command options permits four special substitutions to take place.
They are %B, %M, %W, and %R, which are replaced with the base name
of the widget, the name of the geometry master, the name of the widget,
and the widgets root. A %% gets changed into a single %. For example,
if this panel is instantiated in .toplevel, and the widget is named
widget
, and is managed by the widget frame
,
the following substitutions are made:
%B .toplevel
%M .toplevel.frame
%W .toplevel.widget
%R .toplevel
The values of %B and %R differ only when the panel in instantiated in ".".
- font
- Fonts in SpecTcl are not entered using the X font names. Instead,
they are specified by a comma separated list of fields. The first two
fields are the font family and point size. The remaining
fields consist of zero or more of italic or bold.
- help
- If the help field is used, its contents are
displayed as part of the help message when the cursor is over the widget.
The help is not currently available to the application.
- item_name
- This is the name of the widget, as would be returned by
winfo name
. The application code should use this name
to refer to the widget, as in .top.item_name
, where
.top
is the frame or toplevel the panel is instantiated
in, and item_name
is the name of the widget.
- padx
- pady
- Each widget can have up to three kinds of padding: internal, default,
and external.
- Internal padding forms the bounding box for the
text placed inside of widgets such as buttons or labels. With non-zero
internal padding, the
justify
option will anchor the
text to the proper size of this internal-padding bounding box.
- Default padding is the extra space inside the widget's
border, and outside the text inside the widget.
- External padding is the extra space outside the
widget's border that keeps the border away from the edge of the
cell. External padding only makes a difference if the widget is
set to fill its cavity (with the fill option), or if the widget is
the biggest in its row or column.
- tabbing order
- For this field, an arbitrary text string
is used to alter the default tabbing order of the widgets.
By default, the order is left to right, then top down. The values
of this field are sorted alphabetically to sort the widgets, using
the default order for widgets with the same string. All widgets with no
string indicated are sorted first.
- row
- column
- rowspan
- columnspan
- These four fields indicate the widget's position on the grid to the
table geometry manager. Normally these fields are altered by
direct manipulation of the widgets, and needn't be modified from the
option sheet.
- tags
- This field contains the list of binding tags used for this widget.
If nothing is specified, the default bindtags are
used.