diff options
author | hobbs <hobbs@noemail.net> | 1999-11-23 23:52:12 (GMT) |
---|---|---|
committer | hobbs <hobbs@noemail.net> | 1999-11-23 23:52:12 (GMT) |
commit | 051bac4d1e1ac7f928f7e7be73a7b48b6b7b3be6 (patch) | |
tree | adac85e2547fa56320d1aaeabbc15111a4e44bc5 | |
parent | 4cc438ab1a682d8316321d4e3afae686c95e5459 (diff) | |
download | tk-051bac4d1e1ac7f928f7e7be73a7b48b6b7b3be6.zip tk-051bac4d1e1ac7f928f7e7be73a7b48b6b7b3be6.tar.gz tk-051bac4d1e1ac7f928f7e7be73a7b48b6b7b3be6.tar.bz2 |
* 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
FossilOrigin-Name: 017386d45f83dce3583efada3dfbc9519df1322e
-rw-r--r-- | generic/tk.h | 3 | ||||
-rw-r--r-- | generic/tkConfig.c | 10 | ||||
-rw-r--r-- | 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} }; |