diff options
Diffstat (limited to 'doc/SetOptions.3')
-rw-r--r-- | doc/SetOptions.3 | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/doc/SetOptions.3 b/doc/SetOptions.3 index 08d5342..c568dd6 100644 --- a/doc/SetOptions.3 +++ b/doc/SetOptions.3 @@ -127,20 +127,20 @@ called to free all of its resources. All of the option tables for a Tcl interpreter are freed automatically if the interpreter is deleted. .PP \fBTk_InitOptions\fR is invoked when a new widget is created to set the -default values for all of the widget's configuration options that do not -have \fBTK_OPTION_DONT_SET_DEFAULT\fR set in their \fIflags\fR field. +default values. \fBTk_InitOptions\fR is passed a token for an option table (\fIoptionTable\fR) and a pointer to a widget record (\fIrecordPtr\fR), which is the C structure that holds information about this widget. \fBTk_InitOptions\fR uses the information in the option table to choose an -appropriate default for each option, except those having -\fBTK_OPTION_DONT_SET_DEFAULT\fR set, then it stores the default value +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 \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 is not NULL. +\fIinterp\fR is not NULL. For any widget's configuration option that +has \fBTK_OPTION_DONT_SET_DEFAULT\fR set in its \fIflags\fR field, +the above initialization is fully skipped, see below. .PP \fBTk_SetOptions\fR is invoked to modify configuration options based on information specified in a Tcl command. The command might be one that @@ -533,6 +533,10 @@ 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. +.PP +Ttk widgets do not support the \fIinternalOffset\fR machinery. +Option values of Ttk widgets are always stored as (Tcl_Obj *), meaning that +the \fIobjOffset\fR field must be used. .SH "CUSTOM OPTION TYPES" .PP Applications can extend the built-in configuration types with |