From b6cf1cf2288ef3a39ed7ff39ec16deb96f206f9a Mon Sep 17 00:00:00 2001 From: hobbs Date: Tue, 23 Nov 1999 23:52:13 +0000 Subject: * generic/tk.h: * generic/tkConfig.c: added support for TK_OPTION_DONT_SET_DEFAULT as equiv for TK_CONFIG_DONT_SET_DEFAULT * generic/tkListbox.c: added TK_OPTION_DONT_SET_DEFAULT to the item specs --- generic/tk.h | 3 ++- generic/tkConfig.c | 10 +++++++--- generic/tkListbox.c | 13 ++++++++----- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/generic/tk.h b/generic/tk.h index 68b1805..552611f 100644 --- a/generic/tk.h +++ b/generic/tk.h @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tk.h,v 1.32 1999/10/29 03:57:55 hobbs Exp $ + * RCS: @(#) $Id: tk.h,v 1.33 1999/11/23 23:52:13 hobbs Exp $ */ #ifndef _TK @@ -199,6 +199,7 @@ typedef struct Tk_OptionSpec { */ #define TK_OPTION_NULL_OK 1 +#define TK_OPTION_DONT_SET_DEFAULT 8 /* * Macro to use to fill in "offset" fields of the Tk_OptionSpec. diff --git a/generic/tkConfig.c b/generic/tkConfig.c index 2e02ad0..5ec9203 100644 --- a/generic/tkConfig.c +++ b/generic/tkConfig.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkConfig.c,v 1.5 1999/04/21 21:53:25 rjohnson Exp $ + * RCS: @(#) $Id: tkConfig.c,v 1.6 1999/11/23 23:52:13 hobbs Exp $ */ /* @@ -480,7 +480,12 @@ Tk_InitOptions(interp, recordPtr, optionTable, tkwin) for (optionPtr = tablePtr->options, count = tablePtr->numOptions; count > 0; optionPtr++, count--) { - if (optionPtr->specPtr->type == TK_OPTION_SYNONYM) { + /* + * If we specify TK_OPTION_DONT_SET_DEFAULT, then the user has + * processed and set a default for this already. + */ + if ((optionPtr->specPtr->type == TK_OPTION_SYNONYM) || + (optionPtr->specPtr->flags & TK_OPTION_DONT_SET_DEFAULT)) { continue; } source = TABLE_DEFAULT; @@ -503,7 +508,6 @@ Tk_InitOptions(interp, recordPtr, optionTable, tkwin) /* * Second, check for a system-specific default value. */ - if ((valuePtr == NULL) && (optionPtr->dbNameUID != NULL)) { valuePtr = TkpGetSystemDefault(tkwin, optionPtr->dbNameUID, diff --git a/generic/tkListbox.c b/generic/tkListbox.c index 4b56229..6f4f1ec 100644 --- a/generic/tkListbox.c +++ b/generic/tkListbox.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkListbox.c,v 1.10 1999/11/19 15:48:19 ericm Exp $ + * RCS: @(#) $Id: tkListbox.c,v 1.11 1999/11/23 23:52:13 hobbs Exp $ */ #include "tkPort.h" @@ -270,20 +270,23 @@ static Tk_OptionSpec optionSpecs[] = { static Tk_OptionSpec itemAttrOptionSpecs[] = { {TK_OPTION_BORDER, "-background", "background", "Background", (char *)NULL, -1, Tk_Offset(ItemAttr, border), - TK_OPTION_NULL_OK, (ClientData) DEF_LISTBOX_BG_MONO, 0}, + TK_OPTION_NULL_OK|TK_OPTION_DONT_SET_DEFAULT, + (ClientData) DEF_LISTBOX_BG_MONO, 0}, {TK_OPTION_SYNONYM, "-bg", (char *) NULL, (char *) NULL, (char *) NULL, 0, -1, 0, (ClientData) "-background", 0}, {TK_OPTION_SYNONYM, "-fg", "foreground", (char *) NULL, (char *) NULL, 0, -1, 0, (ClientData) "-foreground", 0}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", (char *) NULL, -1, Tk_Offset(ItemAttr, fgColor), - TK_OPTION_NULL_OK, 0, 0}, + TK_OPTION_NULL_OK|TK_OPTION_DONT_SET_DEFAULT, 0, 0}, {TK_OPTION_BORDER, "-selectbackground", "selectBackground", "Background", (char *) NULL, -1, Tk_Offset(ItemAttr, selBorder), - TK_OPTION_NULL_OK, (ClientData) DEF_LISTBOX_SELECT_MONO, 0}, + TK_OPTION_NULL_OK|TK_OPTION_DONT_SET_DEFAULT, + (ClientData) DEF_LISTBOX_SELECT_MONO, 0}, {TK_OPTION_COLOR, "-selectforeground", "selectForeground", "Foreground", (char *) NULL, -1, Tk_Offset(ItemAttr, selFgColor), - TK_OPTION_NULL_OK, (ClientData) DEF_LISTBOX_SELECT_FG_MONO, 0}, + TK_OPTION_NULL_OK|TK_OPTION_DONT_SET_DEFAULT, + (ClientData) DEF_LISTBOX_SELECT_FG_MONO, 0}, {TK_OPTION_END, (char *) NULL, (char *) NULL, (char *) NULL, (char *) NULL, 0, -1, 0, 0, 0} }; -- cgit v0.12