diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2004-09-19 16:05:34 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2004-09-19 16:05:34 (GMT) |
commit | 9d13fb1cb472be80ac1cea698fcc91be991b0ac4 (patch) | |
tree | 83898b60ed6e9f9dd9a2b525a9ad32172a88d4fc /doc/SetOptions.3 | |
parent | 50324a159a264c9d34c81d447b4926ea75e2cb45 (diff) | |
download | tk-9d13fb1cb472be80ac1cea698fcc91be991b0ac4.zip tk-9d13fb1cb472be80ac1cea698fcc91be991b0ac4.tar.gz tk-9d13fb1cb472be80ac1cea698fcc91be991b0ac4.tar.bz2 |
Standardize style of section refs & public symbols. Remove displayed tabs
Diffstat (limited to 'doc/SetOptions.3')
-rw-r--r-- | doc/SetOptions.3 | 140 |
1 files changed, 70 insertions, 70 deletions
diff --git a/doc/SetOptions.3 b/doc/SetOptions.3 index b079332..7e4dc13 100644 --- a/doc/SetOptions.3 +++ b/doc/SetOptions.3 @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: SetOptions.3,v 1.10 2004/08/22 15:43:20 dkf Exp $ +'\" RCS: @(#) $Id: SetOptions.3,v 1.11 2004/09/19 16:05:36 dkf Exp $ '\" .so man.macros .TH Tk_SetOptions 3 8.1 Tk "Tk Library Procedures" @@ -59,7 +59,7 @@ Points to structure in which values of configuration options are stored; fields of this record are modified by procedures such as \fBTk_SetOptions\fR and read by procedures such as \fBTk_GetOptionValue\fR. .AP Tk_Window tkwin in -For options such as TK_OPTION_COLOR, this argument indicates +For options such as \fBTK_OPTION_COLOR\fR, this argument indicates the window in which the option will be used. If \fIoptionTable\fR uses no window-dependent options, then a NULL value may be supplied for this argument. @@ -138,8 +138,8 @@ uses the information in the option table to choose an appropriate default for each option, then it stores the default value directly into the widget record, overwriting any information that was already present in the widget record. \fBTk_InitOptions\fR normally -returns TCL_OK. If an error occurred while setting the default values -(e.g., because a default value was erroneous) then TCL_ERROR is returned +returns \fBTCL_OK\fR. If an error occurred while setting the default values +(e.g., because a default value was erroneous) then \fBTCL_ERROR\fR is returned and an error message is left in \fIinterp\fR's result if \fIinterp\fR isn't NULL. .PP @@ -153,9 +153,9 @@ an option and the second object gives the new value for that option. \fBTk_SetOptions\fR looks up each name in \fIoptionTable\fR, checks that the new value of the option conforms to the type in \fIoptionTable\fR, and stores the value of the option into the widget record given by -\fIrecordPtr\fR. \fBTk_SetOptions\fR normally returns TCL_OK. If +\fIrecordPtr\fR. \fBTk_SetOptions\fR normally returns \fBTCL_OK\fR. If an error occurred (such as an unknown option name or an illegal option -value) then TCL_ERROR is returned and an error message is left in +value) then \fBTCL_ERROR\fR is returned and an error message is left in \fIinterp\fR's result if \fIinterp\fR isn't NULL. .PP \fBTk_SetOptions\fR has two additional features. First, if the @@ -252,20 +252,20 @@ supported by a particular class of widgets. Each structure specifies one configuration option and has the following fields: .CS typedef struct { - Tk_OptionType \fItype\fR; - char *\fIoptionName\fR; - char *\fIdbName\fR; - char *\fIdbClass\fR; - char *\fIdefValue\fR; - int \fIobjOffset\fR; - int \fIinternalOffset\fR; - int \fIflags\fR; - ClientData \fIclientData\fR; - int \fItypeMask\fR; + Tk_OptionType \fItype\fR; + char *\fIoptionName\fR; + char *\fIdbName\fR; + char *\fIdbClass\fR; + char *\fIdefValue\fR; + int \fIobjOffset\fR; + int \fIinternalOffset\fR; + int \fIflags\fR; + ClientData \fIclientData\fR; + int \fItypeMask\fR; } Tk_OptionSpec; .CE The \fItype\fR field indicates what kind of configuration option this is -(e.g. TK_OPTION_COLOR for a color value, or TK_OPTION_INT for +(e.g. \fBTK_OPTION_COLOR\fB for a color value, or \fBTK_OPTION_INT\fR for an integer value). \fIType\fR determines how the value of the option is parsed (more on this below). The \fIoptionName\fR field is a string such as \fB\-font\fR or \fB\-bg\fR; @@ -285,7 +285,7 @@ The \fIflags\fR field contains additional information to control the processing of this configuration option (see below for details). \fIClientData\fR provides additional type-specific data needed -by certain types. For instance, for TK_OPTION_COLOR types, +by certain types. For instance, for \fBTK_OPTION_COLOR\fR types, \fIclientData\fR is a string giving the default value to use on monochrome displays. See the descriptions of the different types below for details. @@ -302,22 +302,22 @@ If the \fIinternalOffset\fR field of the Tk_OptionSpec is greater than or equal to zero, then the value of the option is stored in a type-specific internal form at the location in the widget record given by \fIinternalOffset\fR. For example, if the option's type is -TK_OPTION_INT then the internal form is an integer. If the +\fBTK_OPTION_INT\fR then the internal form is an integer. If the \fIobjOffset\fR or \fIinternalOffset\fR field is negative then the value is not stored in that form. At least one of the offsets must be greater than or equal to zero. .PP The \fIflags\fR field consists of one or more bits ORed together. At -present only a single flag is supported: TK_OPTION_NULL_OK. If +present only a single flag is supported: \fBTK_OPTION_NULL_OK\fR. If this bit is set for an option then an empty string will be accepted as the value for the option and the resulting internal form will be a NULL pointer, a zero value, or \fBNone\fR, depending on the type of the option. If the flag is not set then empty strings will result in errors. -TK_OPTION_NULL_OK is typically used to allow a +\fBTK_OPTION_NULL_OK\fR is typically used to allow a feature to be turned off entirely, e.g. set a cursor value to \fBNone\fR so that a window simply inherits its parent's cursor. -Not all option types support the TK_OPTION_NULL_OK +Not all option types support the \fBTK_OPTION_NULL_OK\fR flag; for those that do, there is an explicit indication of that fact in the descriptions below. .PP @@ -339,7 +339,7 @@ returned by \fBTk_GetAnchorFromObj\fR. The value must be a standard Tk bitmap name. The internal form is a Pixmap token like the ones returned by \fBTk_AllocBitmapFromObj\fR. This option type requires \fItkwin\fR to be supplied to procedures -such as \fBTk_SetOptions\fR, and it supports the TK_OPTION_NULL_OK flag. +such as \fBTk_SetOptions\fR, and it supports the \fBTK_OPTION_NULL_OK\fR flag. .TP \fBTK_OPTION_BOOLEAN\fR The value must be a standard boolean value such as \fBtrue\fR or @@ -350,14 +350,14 @@ The value must be a standard color name such as \fBred\fR or \fB#ff8080\fR. The internal form is a Tk_3DBorder token like the ones returned by \fBTk_Alloc3DBorderFromObj\fR. This option type requires \fItkwin\fR to be supplied to procedures -such as \fBTk_SetOptions\fR, and it supports the TK_OPTION_NULL_OK flag. +such as \fBTk_SetOptions\fR, and it supports the \fBTK_OPTION_NULL_OK\fR flag. .TP \fBTK_OPTION_COLOR\fR The value must be a standard color name such as \fBred\fR or \fB#ff8080\fR. The internal form is an (XColor *) token like the ones returned by \fBTk_AllocColorFromObj\fR. This option type requires \fItkwin\fR to be supplied to procedures -such as \fBTk_SetOptions\fR, and it supports the TK_OPTION_NULL_OK flag. +such as \fBTk_SetOptions\fR, and it supports the \fBTK_OPTION_NULL_OK\fR flag. .TP \fBTK_OPTION_CURSOR\fR The value must be a standard cursor name such as \fBcross\fR or \fB@foo\fR. @@ -366,25 +366,25 @@ The internal form is a Tk_Cursor token like the ones returned by This option type requires \fItkwin\fR to be supplied to procedures such as \fBTk_SetOptions\fR, and when the option is set the cursor for the window is changed by calling \fBXDefineCursor\fR. This -option type also supports the TK_OPTION_NULL_OK flag. +option type also supports the \fBTK_OPTION_NULL_OK\fR flag. .TP \fBTK_OPTION_CUSTOM\fR This option allows applications to define new option types. The clientData field of the entry points to a structure defining the new -option type. See the section CUSTOM OPTION TYPES below for details. +option type. See the section \fBCUSTOM OPTION TYPES\fR below for details. .TP \fBTK_OPTION_DOUBLE\fR The string value must be a floating-point number in the format accepted by \fBstrtol\fR. The internal form is a C -\fBdouble\fR value. This option type supports the TK_OPTION_NULL_OK +\fBdouble\fR value. This option type supports the \fBTK_OPTION_NULL_OK\fR flag; if a NULL value is set, the internal representation is set to zero. .TP \fBTK_OPTION_END\fR Marks the end of the template. There must be a Tk_OptionSpec structure -with \fItype\fR TK_OPTION_END at the end of each template. If the +with \fItype\fR \fBTK_OPTION_END\fR at the end of each template. If the \fIclientData\fR field of this structure isn't NULL, then it points to an additional array of Tk_OptionSpec's, which is itself terminated by -another TK_OPTION_END entry. Templates may be chained arbitrarily +another \fBTK_OPTION_END\fR entry. Templates may be chained arbitrarily deeply. This feature allows common options to be shared by several widget classes. .TP @@ -393,7 +393,7 @@ The value must be a standard font name such as \fBTimes 16\fR. The internal form is a Tk_Font handle like the ones returned by \fBTk_AllocFontFromObj\fR. This option type requires \fItkwin\fR to be supplied to procedures -such as \fBTk_SetOptions\fR, and it supports the TK_OPTION_NULL_OK flag. +such as \fBTk_SetOptions\fR, and it supports the \fBTK_OPTION_NULL_OK\fR flag. .TP \fBTK_OPTION_INT\fR The string value must be an integer in the format accepted by @@ -413,20 +413,20 @@ distance in pixels, like the values returned by \fBTk_GetPixelsFromObj\fR. Note: if the \fIobjOffset\fR field isn't used then information about the original value of this option will be lost. See \fBOBJOFFSET VS. INTERNALOFFSET\fR below for details. This option -type supports the TK_OPTION_NULL_OK flag; if a NULL value is set, the +type supports the \fBTK_OPTION_NULL_OK\fR flag; if a NULL value is set, the internal representation is set to zero. .TP \fBTK_OPTION_RELIEF\fR The value must be standard relief such as \fBraised\fR. The internal form is an integer relief value such as -TK_RELIEF_RAISED. This option type supports the TK_OPTION_NULL_OK +\fBTK_RELIEF_RAISED\fR. This option type supports the \fBTK_OPTION_NULL_OK\fR flag; if the empty string is specified as the value for the option, -the integer relief value is set to TK_RELIEF_NULL. +the integer relief value is set to \fBTK_RELIEF_NULL\fR. .TP \fBTK_OPTION_STRING\fR The value may be any string. The internal form is a (char *) pointer that points to a dynamically allocated copy of the value. -This option type supports the TK_OPTION_NULL_OK flag. +This option type supports the \fBTK_OPTION_NULL_OK\fR flag. .TP \fBTK_OPTION_STRING_TABLE\fR For this type, \fIclientData\fR is a pointer to an array of strings @@ -449,7 +449,7 @@ The value must be a window path name. The internal form is a \fBTk_Window\fR token for the window. This option type requires \fItkwin\fR to be supplied to procedures such as \fBTk_SetOptions\fR (in order to identify the application), -and it supports the TK_OPTION_NULL_OK flag. +and it supports the \fBTK_OPTION_NULL_OK\fR flag. .SH "STORAGE MANAGEMENT ISSUES" .PP @@ -459,8 +459,8 @@ procedures described here will handle all of the storage allocation and resource management issues associated with the field. When the value of an option is changed, \fBTk_SetOptions\fR (or \fBTk_FreeSavedOptions\fR) will automatically free any resources associated with the old value, such as -Tk_Fonts for TK_OPTION_FONT options or dynamically allocated memory for -TK_OPTION_STRING options. For an option stored as an object using the +Tk_Fonts for \fBTK_OPTION_FONT\fR options or dynamically allocated memory for +\fBTK_OPTION_STRING\fR options. For an option stored as an object using the \fIobjOffset\fR field of a Tk_OptionSpec, the widget record shares the object pointed to by the \fIobjv\fR value from the call to \fBTk_SetOptions\fR. The reference count for this object is incremented @@ -483,13 +483,13 @@ makes the internal form of the value immediately available to the widget code so the value doesn't have to be extracted from an object each time it is used. However, there are two cases where the \fIobjOffset\fR field is useful. The first case is for -TK_OPTION_PIXELS options. In this case, the internal form is +\fBTK_OPTION_PIXELS\fR options. In this case, the internal form is an integer pixel value that is valid only for a particular screen. If the value of the option is retrieved, it will be returned as a simple number. For example, after the command \fB.b configure \-borderwidth 2m\fR, the command \fB.b configure \-borderwidth\fR might return 7, which is the integer pixel value corresponding to \fB2m\fR. Unfortunately, this loses -the original screen-independent value. Thus for TK_OPTION_PIXELS options +the original screen-independent value. Thus for \fBTK_OPTION_PIXELS\fR options it is better to use the \fIobjOffset\fR field. In this case the original value of the option is retained in the object and can be returned when the option is retrieved. In most cases it is convenient to use the @@ -497,11 +497,11 @@ the option is retrieved. In most cases it is convenient to use the immediately available for use in the widget code (alternatively, \fBTk_GetPixelsFromObj\fR can be used to extract the integer value from the object whenever it is needed). Note: the problem of losing information -on retrievals exists only for TK_OPTION_PIXELS options. +on retrievals exists only for \fBTK_OPTION_PIXELS\fR options. .PP The second reason to use the \fIobjOffset\fR field is in order to implement new types of options not supported by these procedures. -To implement a new type of option, you can use TK_OPTION_STRING as +To implement a new type of option, you can use \fBTK_OPTION_STRING\fR as the type in the Tk_OptionSpec structure and set the \fIobjOffset\fR field but not the \fIinternalOffset\fR field. Then, after calling \fBTk_SetOptions\fR, convert the object to internal form yourself. @@ -514,40 +514,40 @@ free, and restore saved copies of the type and creating a structure pointing to those procedures: .CS typedef struct Tk_ObjCustomOption { - char *name; - Tk_CustomOptionSetProc *\fIsetProc\fR; - Tk_CustomOptionGetProc *\fIgetProc\fR; - Tk_CustomOptionRestoreProc *\fIrestoreProc\fR; - Tk_CustomOptionFreeProc *\fIfreeProc\fR; - ClientData \fIclientData\fR; + char *name; + Tk_CustomOptionSetProc *\fIsetProc\fR; + Tk_CustomOptionGetProc *\fIgetProc\fR; + Tk_CustomOptionRestoreProc *\fIrestoreProc\fR; + Tk_CustomOptionFreeProc *\fIfreeProc\fR; + ClientData \fIclientData\fR; } Tk_ObjCustomOption; typedef int Tk_CustomOptionSetProc( - ClientData \fIclientData\fR, - Tcl_Interp *\fIinterp\fR, - Tk_Window \fItkwin\fR, - Tcl_Obj **\fIvaluePtr\fR, - char *\fIrecordPtr\fR, - int \fIinternalOffset\fR, - char *\fIsaveInternalPtr\fR, - int \fIflags\fR); + ClientData \fIclientData\fR, + Tcl_Interp *\fIinterp\fR, + Tk_Window \fItkwin\fR, + Tcl_Obj **\fIvaluePtr\fR, + char *\fIrecordPtr\fR, + int \fIinternalOffset\fR, + char *\fIsaveInternalPtr\fR, + int \fIflags\fR); typedef Tcl_Obj *Tk_CustomOptionGetProc( - ClientData \fIclientData\fR, - Tk_Window \fItkwin\fR, - char *\fIrecordPtr\fR, - int \fIinternalOffset\fR); + ClientData \fIclientData\fR, + Tk_Window \fItkwin\fR, + char *\fIrecordPtr\fR, + int \fIinternalOffset\fR); typedef void Tk_CustomOptionRestoreProc( - ClientData \fIclientData\fR, - Tk_Window \fItkwin\fR, - char *\fIinternalPtr\fR, - char *\fIsaveInternalPtr\fR); + ClientData \fIclientData\fR, + Tk_Window \fItkwin\fR, + char *\fIinternalPtr\fR, + char *\fIsaveInternalPtr\fR); typedef void Tk_CustomOptionFreeProc( - ClientData \fIclientData\fR, - Tk_Window \fItkwin\fR, - char *\fIinternalPtr\fR); + ClientData \fIclientData\fR, + Tk_Window \fItkwin\fR, + char *\fIinternalPtr\fR); .CE .PP The Tk_ObjCustomOption structure contains six fields: a name @@ -583,7 +583,7 @@ value is stored as a (Tcl_Obj *) in the widget record), the Tcl_Obj pointer referenced by \fIvaluePtr\fR is the pointer that will be stored at the objOffset for the option. \fISetProc\fR may modify the value if necessary; for example, \fIsetProc\fR may change the value to -NULL to support the TK_OPTION_NULL_OK flag. +NULL to support the \fBTK_OPTION_NULL_OK\fR flag. .TP \fIrecordPtr\fR A pointer to the start of the widget record to modify. @@ -604,8 +604,8 @@ A copy of the \fIflags\fR field in the Tk_OptionSpec structure for the option .RE .PP -\fISetProc\fR returns a standard Tcl result: TCL_OK to indicate successful -processing, or TCL_ERROR to indicate a failure of any kind. An error +\fISetProc\fR returns a standard Tcl result: \fBTCL_OK\fR to indicate successful +processing, or \fBTCL_ERROR\fR to indicate a failure of any kind. An error message may be left in the Tcl interpreter given by \fIinterp\fR in the case of an error. .PP |