Index: doc/SetOptions.3 ================================================================== --- doc/SetOptions.3 +++ doc/SetOptions.3 @@ -128,24 +128,24 @@ option table is no longer needed \fBTk_DeleteOptionTable\fR should be 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 creates a new widget, or a command that modifies options on an existing widget. The \fIobjc\fR and \fIobjv\fR arguments describe the Index: generic/tkListbox.c ================================================================== --- generic/tkListbox.c +++ generic/tkListbox.c @@ -315,30 +315,27 @@ * The itemAttrOptionSpecs table defines the valid configuration options for * listbox items. */ static const Tk_OptionSpec itemAttrOptionSpecs[] = { - {TK_OPTION_BORDER, "-background", "background", "Background", + {TK_OPTION_BORDER, "-background", NULL, NULL, NULL, -1, Tk_Offset(ItemAttr, border), - TK_OPTION_NULL_OK|TK_OPTION_DONT_SET_DEFAULT, - DEF_LISTBOX_BG_MONO, 0}, + TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, NULL, 0, -1, 0, "-background", 0}, {TK_OPTION_SYNONYM, "-fg", "foreground", NULL, NULL, 0, -1, 0, "-foreground", 0}, - {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", + {TK_OPTION_COLOR, "-foreground", NULL, NULL, NULL, -1, Tk_Offset(ItemAttr, fgColor), - TK_OPTION_NULL_OK|TK_OPTION_DONT_SET_DEFAULT, 0, 0}, - {TK_OPTION_BORDER, "-selectbackground", "selectBackground", "Foreground", + TK_OPTION_NULL_OK, NULL, 0}, + {TK_OPTION_BORDER, "-selectbackground", NULL, NULL, NULL, -1, Tk_Offset(ItemAttr, selBorder), - TK_OPTION_NULL_OK|TK_OPTION_DONT_SET_DEFAULT, - DEF_LISTBOX_SELECT_MONO, 0}, - {TK_OPTION_COLOR, "-selectforeground", "selectForeground", "Background", + TK_OPTION_NULL_OK, NULL, 0}, + {TK_OPTION_COLOR, "-selectforeground", NULL, NULL, NULL, -1, Tk_Offset(ItemAttr, selFgColor), - TK_OPTION_NULL_OK|TK_OPTION_DONT_SET_DEFAULT, - DEF_LISTBOX_SELECT_FG_MONO, 0}, - {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, -1, 0, 0, 0} + TK_OPTION_NULL_OK, NULL, 0}, + {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, -1, 0, NULL, 0} }; /* * The following tables define the listbox widget commands (and sub-commands) * and map the indexes into the string tables into enumerated types used to Index: generic/tkTextTag.c ================================================================== --- generic/tkTextTag.c +++ generic/tkTextTag.c @@ -43,14 +43,14 @@ NULL, -1, Tk_Offset(TkTextTag, border), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BITMAP, "-bgstipple", NULL, NULL, NULL, -1, Tk_Offset(TkTextTag, bgStipple), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-borderwidth", NULL, NULL, NULL, Tk_Offset(TkTextTag, borderWidthPtr), Tk_Offset(TkTextTag, borderWidth), - TK_OPTION_NULL_OK|TK_OPTION_DONT_SET_DEFAULT, 0, 0}, + TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-elide", NULL, NULL, NULL, -1, Tk_Offset(TkTextTag, elideString), - TK_OPTION_NULL_OK|TK_OPTION_DONT_SET_DEFAULT, 0, 0}, + TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BITMAP, "-fgstipple", NULL, NULL, NULL, -1, Tk_Offset(TkTextTag, fgStipple), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_FONT, "-font", NULL, NULL, NULL, -1, Tk_Offset(TkTextTag, tkfont), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_COLOR, "-foreground", NULL, NULL, Index: tests/listbox.test ================================================================== --- tests/listbox.test +++ tests/listbox.test @@ -2828,25 +2828,25 @@ listbox .l .l insert end a b c d .l itemconfigure 0 } -cleanup { destroy .l -} -result [list {-background background Background {} {}} \ +} -result [list {-background {} {} {} {}} \ {-bg -background} \ {-fg -foreground} \ - {-foreground foreground Foreground {} {}} \ - {-selectbackground selectBackground Foreground {} {}} \ - {-selectforeground selectForeground Background {} {}}] + {-foreground {} {} {} {}} \ + {-selectbackground {} {} {} {}} \ + {-selectforeground {} {} {} {}}] test listbox-23.3 {ConfigureListboxItem, itemco shortcut} -setup { destroy .l } -body { listbox .l .l insert end a b c d .l itemco 0 -background } -cleanup { destroy .l -} -result {-background background Background {} {}} +} -result {-background {} {} {} {}} test listbox-23.4 {ConfigureListboxItem, wrong num args} -setup { destroy .l } -body { listbox .l .l insert end a