diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2012-07-16 12:36:40 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2012-07-16 12:36:40 (GMT) |
commit | a96a4263f85fa276c74672a7e28251691f0c7680 (patch) | |
tree | 83188d92aa77a52a178e0ae85ba5439c402f4eca /generic/tkColor.c | |
parent | da1c30ff0d8a05251ef3ab0e9f6a5c5bae6f7b14 (diff) | |
download | tk-a96a4263f85fa276c74672a7e28251691f0c7680.zip tk-a96a4263f85fa276c74672a7e28251691f0c7680.tar.gz tk-a96a4263f85fa276c74672a7e28251691f0c7680.tar.bz2 |
Working towards adding all the Tcl_SetErrorCode calls that should be there.
** WORK IN PROGRESS **
Diffstat (limited to 'generic/tkColor.c')
-rw-r--r-- | generic/tkColor.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/generic/tkColor.c b/generic/tkColor.c index 9383a92..b1ed4f1 100644 --- a/generic/tkColor.c +++ b/generic/tkColor.c @@ -226,9 +226,11 @@ Tk_GetColor( if (*name == '#') { Tcl_AppendResult(interp, "invalid color name \"", name, "\"", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "COLOR", NULL); } else { Tcl_AppendResult(interp, "unknown color name \"", name, "\"", NULL); + Tcl_SetErrorCode(interp, "TK", "LOOKUP", "COLOR", name, NULL); } } if (isNew) { @@ -372,10 +374,12 @@ Tk_NameOfColor( sprintf(tsdPtr->rgbString, "#%04x%04x%04x", colorPtr->red, colorPtr->green, colorPtr->blue); - /* If the string has the form #RSRSTUTUVWVW (where equal - * letters denote equal hexdigits) then this is - * equivalent to #RSTUVW. Then output the shorter form. + /* + * If the string has the form #RSRSTUTUVWVW (where equal letters + * denote equal hexdigits) then this is equivalent to #RSTUVW. Then + * output the shorter form. */ + if ((tsdPtr->rgbString[1] == tsdPtr->rgbString[3]) && (tsdPtr->rgbString[2] == tsdPtr->rgbString[4]) && (tsdPtr->rgbString[5] == tsdPtr->rgbString[7]) |