summaryrefslogtreecommitdiffstats
path: root/doc/ConfigWidg.3
diff options
context:
space:
mode:
Diffstat (limited to 'doc/ConfigWidg.3')
-rw-r--r--doc/ConfigWidg.3114
1 files changed, 57 insertions, 57 deletions
diff --git a/doc/ConfigWidg.3 b/doc/ConfigWidg.3
index b3b358e..69810a2 100644
--- a/doc/ConfigWidg.3
+++ b/doc/ConfigWidg.3
@@ -5,7 +5,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: ConfigWidg.3,v 1.11 2004/08/22 15:43:20 dkf Exp $
+'\" RCS: @(#) $Id: ConfigWidg.3,v 1.12 2004/09/19 16:05:36 dkf Exp $
'\"
.so man.macros
.TH Tk_ConfigureWidget 3 4.1 Tk "Tk Library Procedures"
@@ -45,8 +45,8 @@ modified by \fBTk_ConfigureWidget\fR to hold configuration information.
.AP int flags in
If non-zero, then it specifies an OR-ed combination of flags that
control the processing of configuration information.
-TK_CONFIG_ARGV_ONLY causes the option database and defaults to be
-ignored, and flag bits TK_CONFIG_USER_BIT and higher are used to
+\fBTK_CONFIG_ARGV_ONLY\fR causes the option database and defaults to be
+ignored, and flag bits \fBTK_CONFIG_USER_BIT\fR and higher are used to
selectively disable entries in \fIspecs\fR.
.AP "type name" type in
The name of the type of a widget record.
@@ -89,10 +89,10 @@ a table specifying the configuration options that are supported
\fIargv\fR) to fill in fields of a record (\fIwidgRec\fR).
It uses the option database and defaults specified in \fIspecs\fR
to fill in fields of \fIwidgRec\fR that are not specified in \fIargv\fR.
-\fBTk_ConfigureWidget\fR normally returns the value TCL_OK; in this
+\fBTk_ConfigureWidget\fR normally returns the value \fBTCL_OK\fR; in this
case it does not modify \fIinterp\fR.
If an error
-occurs then TCL_ERROR is returned and \fBTk_ConfigureWidget\fR will
+occurs then \fBTCL_ERROR\fR is returned and \fBTk_ConfigureWidget\fR will
leave an error message in \fIinterp->result\fR in the standard Tcl
fashion.
In the event of an error return, some of the fields of \fIwidgRec\fR
@@ -106,18 +106,18 @@ expected by the widget. Each of its entries specifies one configuration
option and has the following structure:
.CS
typedef struct {
- int \fItype\fR;
- char *\fIargvName\fR;
- char *\fIdbName\fR;
- char *\fIdbClass\fR;
- char *\fIdefValue\fR;
- int \fIoffset\fR;
- int \fIspecFlags\fR;
- Tk_CustomOption *\fIcustomPtr\fR;
+ int \fItype\fR;
+ char *\fIargvName\fR;
+ char *\fIdbName\fR;
+ char *\fIdbClass\fR;
+ char *\fIdefValue\fR;
+ int \fIoffset\fR;
+ int \fIspecFlags\fR;
+ Tk_CustomOption *\fIcustomPtr\fR;
} Tk_ConfigSpec;
.CE
The \fItype\fR field indicates what type of configuration option this is
-(e.g. TK_CONFIG_COLOR for a color value, or TK_CONFIG_INT for
+(e.g. \fBTK_CONFIG_COLOR\fR for a color value, or \fBTK_CONFIG_INT\fR for
an integer value). The \fItype\fR field indicates how to use the
value of the option (more on this below).
The \fIargvName\fR field is a string such as ``\-font'' or ``\-bg'',
@@ -132,7 +132,7 @@ about this option, and \fIspecFlags\fR contains additional information
to control the processing of this configuration option (see FLAGS
below).
The last field, \fIcustomPtr\fR, is only used if \fItype\fR is
-TK_CONFIG_CUSTOM; see CUSTOM OPTION TYPES below.
+\fBTK_CONFIG_CUSTOM\fR; see CUSTOM OPTION TYPES below.
.PP
\fBTk_ConfigureWidget\fR first processes \fIargv\fR to see which
(if any) configuration options are specified there. \fIArgv\fR
@@ -148,15 +148,15 @@ a value is found, then it is used as the value for the option.
Finally, if no entry is found in the option database, the
\fIdefValue\fR field of the \fIspecs\fR entry is used as the
value for the configuration option. If the \fIdefValue\fR is
-NULL, or if the TK_CONFIG_DONT_SET_DEFAULT bit is set in
+NULL, or if the \fBTK_CONFIG_DONT_SET_DEFAULT\fR bit is set in
\fIflags\fR, then there is no default value and this \fIspecs\fR entry
will be ignored if no value is specified in \fIargv\fR or the
option database.
.PP
Once a string value has been determined for a configuration option,
\fBTk_ConfigureWidget\fR translates the string value into a more useful
-form, such as a color if \fItype\fR is TK_CONFIG_COLOR or an integer
-if \fItype\fR is TK_CONFIG_INT. This value is then stored in the
+form, such as a color if \fItype\fR is \fBTK_CONFIG_COLOR\fR or an integer
+if \fItype\fR is \fBTK_CONFIG_INT\fR. This value is then stored in the
record pointed to by \fIwidgRec\fR. This record is assumed to
contain information relevant to the manager of the widget; its exact
type is unknown to \fBTk_ConfigureWidget\fR. The \fIoffset\fR field
@@ -179,7 +179,7 @@ The value is converted to a \fBTk_Cursor\fR by calling
\fBTk_GetCursor\fR and the result is stored in the target.
In addition, the resulting cursor is made the active cursor
for \fItkwin\fR by calling \fBXDefineCursor\fR.
-If TK_CONFIG_NULL_OK is specified in \fIspecFlags\fR then the value
+If \fBTK_CONFIG_NULL_OK\fR is specified in \fIspecFlags\fR then the value
may be an empty string, in which case the target and \fItkwin\fR's
active cursor will be set to \fBNone\fR.
If the previous value of the target
@@ -196,7 +196,7 @@ The value must be an ASCII string identifying a bitmap in a form
suitable for passing to \fBTk_GetBitmap\fR. The value is converted
to a \fBPixmap\fR by calling \fBTk_GetBitmap\fR and the result
is stored in the target.
-If TK_CONFIG_NULL_OK is specified in \fIspecFlags\fR then the value
+If \fBTK_CONFIG_NULL_OK\fR is specified in \fIspecFlags\fR then the value
may be an empty string, in which case the target is set to \fBNone\fR.
If the previous value of the target
wasn't \fBNone\fR, then it is freed by passing it to \fBTk_FreeBitmap\fR.
@@ -215,7 +215,7 @@ The value must be an ASCII string identifying a border color in a form
suitable for passing to \fBTk_Get3DBorder\fR. The value is converted
to a (\fBTk_3DBorder *\fR) by calling \fBTk_Get3DBorder\fR and the result
is stored in the target.
-If TK_CONFIG_NULL_OK is specified in \fIspecFlags\fR then the value
+If \fBTK_CONFIG_NULL_OK\fR is specified in \fIspecFlags\fR then the value
may be an empty string, in which case the target will be set to NULL.
If the previous value of the target
wasn't NULL, then it is freed by passing it to \fBTk_Free3DBorder\fR.
@@ -233,7 +233,7 @@ The value must be an ASCII string identifying a color in a form
suitable for passing to \fBTk_GetColor\fR. The value is converted
to an (\fBXColor *\fR) by calling \fBTk_GetColor\fR and the result
is stored in the target.
-If TK_CONFIG_NULL_OK is specified in \fIspecFlags\fR then the value
+If \fBTK_CONFIG_NULL_OK\fR is specified in \fIspecFlags\fR then the value
may be an empty string, in which case the target will be set to \fBNone\fR.
If the previous value of the target
wasn't NULL, then it is freed by passing it to \fBTk_FreeColor\fR.
@@ -246,7 +246,7 @@ that the new cursor is not made the active one for \fItkwin\fR.
This option allows applications to define new option types.
The \fIcustomPtr\fR field of the entry points to a structure
defining the new option type.
-See the section CUSTOM OPTION TYPES below for details.
+See the section \fBCUSTOM OPTION TYPES\fR below for details.
.TP
\fBTK_CONFIG_DOUBLE\fR
The value must be an ASCII floating-point number in
@@ -264,7 +264,7 @@ The value must be an ASCII string identifying a font in a form
suitable for passing to \fBTk_GetFont\fR. The value is converted
to a \fBTk_Font\fR by calling \fBTk_GetFont\fR and the result
is stored in the target.
-If TK_CONFIG_NULL_OK is specified in \fIspecFlags\fR then the value
+If \fBTK_CONFIG_NULL_OK\fR is specified in \fIspecFlags\fR then the value
may be an empty string, in which case the target will be set to NULL.
If the previous value of the target
wasn't NULL, then it is freed by passing it to \fBTk_FreeFont\fR.
@@ -314,7 +314,7 @@ A copy
of the value is made by allocating memory space with
\fBTcl_Alloc\fR and copying the value into the dynamically-allocated
space. A pointer to the new string is stored in the target.
-If TK_CONFIG_NULL_OK is specified in \fIspecFlags\fR then the value
+If \fBTK_CONFIG_NULL_OK\fR is specified in \fIspecFlags\fR then the value
may be an empty string, in which case the target will be set to NULL.
If the previous value of the target wasn't NULL, then it is
freed by passing it to \fBTcl_Free\fR.
@@ -322,10 +322,10 @@ freed by passing it to \fBTcl_Free\fR.
\fBTK_CONFIG_SYNONYM\fR
This \fItype\fR value identifies special entries in \fIspecs\fR that
are synonyms for other entries. If an \fIargv\fR value matches the
-\fIargvName\fR of a TK_CONFIG_SYNONYM entry, the entry isn't used
+\fIargvName\fR of a \fBTK_CONFIG_SYNONYM\fR entry, the entry isn't used
directly. Instead, \fBTk_ConfigureWidget\fR searches \fIspecs\fR
for another entry whose \fIargvName\fR is the same as the \fIdbName\fR
-field in the TK_CONFIG_SYNONYM entry; this new entry is used just
+field in the \fBTK_CONFIG_SYNONYM\fR entry; this new entry is used just
as if its \fIargvName\fR had matched the \fIargv\fR value. The
synonym mechanism allows multiple \fIargv\fR values to be used for
a single configuration option, such as ``\-background'' and ``\-bg''.
@@ -334,7 +334,7 @@ a single configuration option, such as ``\-background'' and ``\-bg''.
The value is translated to a \fBTk_Uid\fR
(by passing it to \fBTk_GetUid\fR). The resulting value
is stored in the target.
-If TK_CONFIG_NULL_OK is specified in \fIspecFlags\fR and the value
+If \fBTK_CONFIG_NULL_OK\fR is specified in \fIspecFlags\fR and the value
is an empty string then the target will be set to NULL.
.TP
\fBTK_CONFIG_WINDOW\fR
@@ -346,8 +346,8 @@ The value must be a window path name. It is translated to a
In some cases it is useful to generate multiple resources from
a single configuration value. For example, a color name might
be used both to generate the background color for a widget (using
-TK_CONFIG_COLOR) and to generate a 3-D border to draw around the
-widget (using TK_CONFIG_BORDER). In cases like this it is possible
+\fBTK_CONFIG_COLOR\fR) and to generate a 3-D border to draw around the
+widget (using \fBTK_CONFIG_BORDER\fR). In cases like this it is possible
to specify that several consecutive entries in \fIspecs\fR are to
be treated as a group. The first entry is used to determine a value
(using its \fIargvName\fR, \fIdbName\fR,
@@ -368,7 +368,7 @@ options. These values are used in three different ways as
described below.
.PP
First, if the \fIflags\fR argument to \fBTk_ConfigureWidget\fR has
-the TK_CONFIG_ARGV_ONLY bit set (i.e., \fIflags\fR | TK_CONFIG_ARGV_ONLY != 0),
+the \fBTK_CONFIG_ARGV_ONLY\fR bit set (i.e., \fIflags\fR | \fBTK_CONFIG_ARGV_ONLY\fR != 0),
then the option database and
\fIdefValue\fR fields are not used. In this case, if an entry in
\fIspecs\fR doesn't match a field in \fIargv\fR then nothing happens:
@@ -424,14 +424,14 @@ It will be zero in all other entries.
This bit provides a way for clients to determine which values
actually changed in a call to \fBTk_ConfigureWidget\fR.
.PP
-The TK_CONFIG_MONO_ONLY and TK_CONFIG_COLOR_ONLY flags are typically
+The \fBTK_CONFIG_MONO_ONLY\fR and \fBTK_CONFIG_COLOR_ONLY\fR flags are typically
used to specify different default values for
monochrome and color displays. This is done by creating two
entries in \fIspecs\fR that are identical except for their
\fIdefValue\fR and \fIspecFlags\fR fields. One entry should have
-the value TK_CONFIG_MONO_ONLY in its \fIspecFlags\fR and the
+the value \fBTK_CONFIG_MONO_ONLY\fR in its \fIspecFlags\fR and the
default value for monochrome displays in its \fIdefValue\fR; the
-other entry should have the value TK_CONFIG_COLOR_ONLY in
+other entry should have the value \fBTK_CONFIG_COLOR_ONLY\fR in
its \fIspecFlags\fR and the appropriate \fIdefValue\fR for
color displays.
.PP
@@ -443,7 +443,7 @@ a single \fIspecs\fR table to be created with all the configuration
options for all the widget types. When processing a particular
widget type, only entries relevant to that type will be used. This
effect is achieved by setting the high-order bits (those in positions
-equal to or greater than TK_CONFIG_USER_BIT) in \fIspecFlags\fR
+equal to or greater than \fBTK_CONFIG_USER_BIT\fR) in \fIspecFlags\fR
values or in \fIflags\fR. In order for a particular entry in
\fIspecs\fR to be used, its high-order bits must match exactly
the high-order bits of the \fIflags\fR value passed to
@@ -475,7 +475,7 @@ a widget (\fIwidgRec\fR), and a NULL \fIargvName\fR argument,
\fBTk_ConfigureInfo\fR generates a string describing all of the
configuration options for the window. The string is placed
in \fIinterp->result\fR. Under normal circumstances
-it returns TCL_OK; if an error occurs then it returns TCL_ERROR
+it returns \fBTCL_OK\fR; if an error occurs then it returns \fBTCL_ERROR\fR
and \fIinterp->result\fR contains an error message.
.PP
If \fIargvName\fR is NULL, then the value left in
@@ -483,7 +483,7 @@ If \fIargvName\fR is NULL, then the value left in
consists of a list of one or more entries, each of which describes
one configuration option (i.e. one entry in \fIspecs\fR). Each
entry in the list will contain either two or five values. If the
-corresponding entry in \fIspecs\fR has type TK_CONFIG_SYNONYM, then
+corresponding entry in \fIspecs\fR has type \fBTK_CONFIG_SYNONYM\fR, then
the list will contain two values: the \fIargvName\fR for the entry
and the \fIdbName\fR (synonym name). Otherwise the list will contain
five values: \fIargvName\fR, \fIdbName\fR, \fIdbClass\fR, \fIdefValue\fR,
@@ -505,10 +505,10 @@ the \fIspecs\fR entries to consider, just as for \fBTk_ConfigureWidget\fR.
\fBTk_ConfigureValue\fR takes arguments similar to \fBTk_ConfigureInfo\fR;
instead of returning a list of values, it just returns the current value
of the option given by \fIargvName\fR (\fIargvName\fR must not be NULL).
-The value is returned in \fIinterp->result\fR and TCL_OK is
+The value is returned in \fIinterp->result\fR and \fBTCL_OK\fR is
normally returned as the procedure's result.
If an error occurs in \fBTk_ConfigureValue\fR (e.g., \fIargvName\fR is
-not a valid option name), TCL_ERROR is returned and an error message
+not a valid option name), \fBTCL_ERROR\fR is returned and an error message
is left in \fIinterp->result\fR.
This procedure is typically called to implement \fBcget\fR widget
commands.
@@ -519,7 +519,7 @@ The \fBTk_FreeOptions\fR procedure may be invoked during widget cleanup
to release all of the resources associated with configuration options.
It scans through \fIspecs\fR and for each entry corresponding to a
resource that must be explicitly freed (e.g. those with
-type TK_CONFIG_COLOR), it frees the resource in the widget record.
+type \fBTK_CONFIG_COLOR\fR), it frees the resource in the widget record.
If the field in the widget record doesn't refer to a resource (e.g.
it contains a null pointer) then no resource is freed for that
entry.
@@ -533,25 +533,25 @@ configuration types by writing procedures to parse and print options
of the a type and creating a structure pointing to those procedures:
.CS
typedef struct Tk_CustomOption {
- Tk_OptionParseProc *\fIparseProc\fR;
- Tk_OptionPrintProc *\fIprintProc\fR;
- ClientData \fIclientData\fR;
+ Tk_OptionParseProc *\fIparseProc\fR;
+ Tk_OptionPrintProc *\fIprintProc\fR;
+ ClientData \fIclientData\fR;
} Tk_CustomOption;
typedef int Tk_OptionParseProc(
- ClientData \fIclientData\fR,
- Tcl_Interp *\fIinterp\fR,
- Tk_Window \fItkwin\fR,
- char *\fIvalue\fR,
- char *\fIwidgRec\fR,
- int \fIoffset\fR);
+ ClientData \fIclientData\fR,
+ Tcl_Interp *\fIinterp\fR,
+ Tk_Window \fItkwin\fR,
+ char *\fIvalue\fR,
+ char *\fIwidgRec\fR,
+ int \fIoffset\fR);
typedef char *Tk_OptionPrintProc(
- ClientData \fIclientData\fR,
- Tk_Window \fItkwin\fR,
- char *\fIwidgRec\fR,
- int \fIoffset\fR,
- Tcl_FreeProc **\fIfreeProcPtr\fR);
+ ClientData \fIclientData\fR,
+ Tk_Window \fItkwin\fR,
+ char *\fIwidgRec\fR,
+ int \fIoffset\fR,
+ Tcl_FreeProc **\fIfreeProcPtr\fR);
.CE
The Tk_CustomOption structure contains three fields, which are pointers
to the two procedures and a \fIclientData\fR value to be passed to those
@@ -579,8 +579,8 @@ The last argument, \fIoffset\fR, gives the offset in bytes from the start
of the widget record to the location where the option value is to
be placed. The procedure should translate the string to whatever
form is appropriate for the option and store the value in the widget
-record. It should normally return TCL_OK, but if an error occurs
-in translating the string to a value then it should return TCL_ERROR
+record. It should normally return \fBTCL_OK\fR, but if an error occurs
+in translating the string to a value then it should return \fBTCL_ERROR\fR
and store an error message in \fIinterp->result\fR.
.PP
The \fIprintProc\fR procedure is called
@@ -602,7 +602,7 @@ need not do anything with the \fIfreeProcPtr\fR argument.
Once \fIparseProc\fR and \fIprintProc\fR have been defined and a
Tk_CustomOption structure has been created for them, options of this
new type may be manipulated with Tk_ConfigSpec entries whose \fItype\fR
-fields are TK_CONFIG_CUSTOM and whose \fIcustomPtr\fR fields point
+fields are \fBTK_CONFIG_CUSTOM\fR and whose \fIcustomPtr\fR fields point
to the Tk_CustomOption structure.
.SH EXAMPLES