summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--carbon/tkMacOSXEmbed.c16
-rw-r--r--generic/tkArgv.c2
-rw-r--r--generic/tkBind.c11
-rw-r--r--generic/tkCanvArc.c4
-rw-r--r--generic/tkCanvBmap.c2
-rw-r--r--generic/tkCanvLine.c6
-rw-r--r--generic/tkCanvPoly.c4
-rw-r--r--generic/tkCanvText.c4
-rw-r--r--generic/tkCanvWind.c2
-rw-r--r--generic/tkCanvas.c2
-rw-r--r--generic/tkFont.c2
-rw-r--r--generic/tkGrab.c2
-rw-r--r--generic/tkGrid.c4
-rw-r--r--generic/tkImgBmap.c4
-rw-r--r--generic/tkImgPhoto.c67
-rw-r--r--generic/tkListbox.c4
-rw-r--r--generic/tkRectOval.c2
-rw-r--r--generic/tkText.c103
-rw-r--r--generic/tkTextIndex.c2
-rw-r--r--generic/tkTrig.c4
-rw-r--r--macosx/tkMacOSXEmbed.c16
-rw-r--r--unix/tkUnixCursor.c20
-rw-r--r--unix/tkUnixEmbed.c16
-rw-r--r--unix/tkUnixWm.c12
-rw-r--r--win/tkWinDialog.c3
-rw-r--r--win/tkWinEmbed.c4
-rw-r--r--win/tkWinWm.c12
-rw-r--r--win/ttkWinXPTheme.c4
28 files changed, 160 insertions, 174 deletions
diff --git a/carbon/tkMacOSXEmbed.c b/carbon/tkMacOSXEmbed.c
index e99740c..39e9aaa 100644
--- a/carbon/tkMacOSXEmbed.c
+++ b/carbon/tkMacOSXEmbed.c
@@ -210,7 +210,7 @@ TkpUseWindow(
if (winPtr->window != None) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"can't modify container after widget is created", -1));
- Tcl_SetErrorCode(interp, "TK", "EMBED", "CREATION", NULL);
+ Tcl_SetErrorCode(interp, "TK", "EMBED", "POST_CREATE", NULL);
return TCL_ERROR;
}
@@ -228,14 +228,12 @@ TkpUseWindow(
}
usePtr = (TkWindow *) Tk_IdToWindow(winPtr->display, (Window) parent);
- if (usePtr != NULL) {
- if (!(usePtr->flags & TK_CONTAINER)) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "window \"%s\" doesn't have -container option set",
- usePtr->pathName));
- Tcl_SetErrorCode(interp, "TK", "EMBED", "TARGET", NULL);
- return TCL_ERROR;
- }
+ if (usePtr != NULL && !(usePtr->flags & TK_CONTAINER)) {
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf(
+ "window \"%s\" doesn't have -container option set",
+ usePtr->pathName));
+ Tcl_SetErrorCode(interp, "TK", "EMBED", "CONTAINER", NULL);
+ return TCL_ERROR;
}
/*
diff --git a/generic/tkArgv.c b/generic/tkArgv.c
index 56f628b..dbcfc7d 100644
--- a/generic/tkArgv.c
+++ b/generic/tkArgv.c
@@ -282,7 +282,7 @@ Tk_ParseArgv(
default:
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"bad argument type %d in Tk_ArgvInfo", infoPtr->type));
- Tcl_SetErrorCode(interp, "TK", "ARG", "BAD_TYPE", NULL);
+ Tcl_SetErrorCode(interp, "TK", "API_ABUSE", NULL);
return TCL_ERROR;
}
}
diff --git a/generic/tkBind.c b/generic/tkBind.c
index 58e91c4..974c1f9 100644
--- a/generic/tkBind.c
+++ b/generic/tkBind.c
@@ -2919,7 +2919,8 @@ HandleEventGenerate(
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"window id \"%s\" doesn't exist in this application",
Tcl_GetString(objv[0])));
- Tcl_SetErrorCode(interp, "TK", "LOOKUP", "WINDOW", NULL);
+ Tcl_SetErrorCode(interp, "TK", "LOOKUP", "WINDOW",
+ Tcl_GetString(objv[0]), NULL);
return TCL_ERROR;
}
@@ -3162,7 +3163,8 @@ HandleEventGenerate(
if (keysym == NoSymbol) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"unknown keysym \"%s\"", value));
- Tcl_SetErrorCode(interp, "TK", "LOOKUP", "KEYSYM", NULL);
+ Tcl_SetErrorCode(interp, "TK", "LOOKUP", "KEYSYM", value,
+ NULL);
return TCL_ERROR;
}
@@ -3170,7 +3172,8 @@ HandleEventGenerate(
if (event.general.xkey.keycode == 0) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"no keycode for keysym \"%s\"", value));
- Tcl_SetErrorCode(interp, "TK", "LOOKUP", "KEYCODE", NULL);
+ Tcl_SetErrorCode(interp, "TK", "LOOKUP", "KEYCODE", value,
+ NULL);
return TCL_ERROR;
}
if (!(flags & KEY)
@@ -3498,7 +3501,7 @@ NameToWindow(
badWindow:
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"bad window name/identifier \"%s\"", name));
- Tcl_SetErrorCode(interp, "TK", "LOOKUP", "WINDOW_ID", NULL);
+ Tcl_SetErrorCode(interp, "TK", "LOOKUP", "WINDOW_ID", name, NULL);
return TCL_ERROR;
}
diff --git a/generic/tkCanvArc.c b/generic/tkCanvArc.c
index d32c717..4e4c582 100644
--- a/generic/tkCanvArc.c
+++ b/generic/tkCanvArc.c
@@ -1997,7 +1997,7 @@ ArcToPostscript(
*/
(void) Tcl_RestoreInterpState(interp, interpState);
- Tcl_AppendResult(interp, Tcl_GetString(psObj), NULL);
+ Tcl_AppendObjToObj(Tcl_GetObjResult(interp), psObj);
Tcl_DecrRefCount(psObj);
return TCL_OK;
@@ -2063,7 +2063,7 @@ StyleParseProc(
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"bad -style option \"%s\": must be arc, chord, or pieslice",
value));
- Tcl_SetErrorCode(interp, "TK", "CANVAS", "ARCSTYLE", NULL);
+ Tcl_SetErrorCode(interp, "TK", "CANVAS", "ARC_STYLE", NULL);
*stylePtr = PIESLICE_STYLE;
return TCL_ERROR;
}
diff --git a/generic/tkCanvBmap.c b/generic/tkCanvBmap.c
index 65c4b59..d7d54f4 100644
--- a/generic/tkCanvBmap.c
+++ b/generic/tkCanvBmap.c
@@ -991,7 +991,7 @@ BitmapToPostscript(
*/
(void) Tcl_RestoreInterpState(interp, interpState);
- Tcl_AppendResult(interp, Tcl_GetString(psObj), NULL);
+ Tcl_AppendObjToObj(Tcl_GetObjResult(interp), psObj);
Tcl_DecrRefCount(psObj);
return TCL_OK;
diff --git a/generic/tkCanvLine.c b/generic/tkCanvLine.c
index ce51759..9d68c37 100644
--- a/generic/tkCanvLine.c
+++ b/generic/tkCanvLine.c
@@ -1800,7 +1800,7 @@ GetLineIndex(
badIndex:
Tcl_ResetResult(interp);
Tcl_SetObjResult(interp, Tcl_ObjPrintf("bad index \"%s\"", string));
- Tcl_SetErrorCode(interp, "TK", "CANVAS", "ITEMINDEX", "LINE", NULL);
+ Tcl_SetErrorCode(interp, "TK", "CANVAS", "ITEM_INDEX", "LINE", NULL);
return TCL_ERROR;
}
@@ -1918,7 +1918,7 @@ ParseArrowShape(
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"bad arrow shape \"%s\": must be list with three numbers",
value));
- Tcl_SetErrorCode(interp, "TK", "CANVAS", "ARROWSHAPE", NULL);
+ Tcl_SetErrorCode(interp, "TK", "CANVAS", "ARROW_SHAPE", NULL);
if (argv != NULL) {
ckfree(argv);
}
@@ -2433,7 +2433,7 @@ LineToPostscript(
done:
(void) Tcl_RestoreInterpState(interp, interpState);
- Tcl_AppendResult(interp, Tcl_GetString(psObj), NULL);
+ Tcl_AppendObjToObj(Tcl_GetObjResult(interp), psObj);
Tcl_DecrRefCount(psObj);
return TCL_OK;
diff --git a/generic/tkCanvPoly.c b/generic/tkCanvPoly.c
index 7e2834d..f8ea42b 100644
--- a/generic/tkCanvPoly.c
+++ b/generic/tkCanvPoly.c
@@ -1732,7 +1732,7 @@ GetPolygonIndex(
badIndex:
Tcl_SetObjResult(interp, Tcl_ObjPrintf("bad index \"%s\"", string));
- Tcl_SetErrorCode(interp, "TK", "CANVAS", "ITEMINDEX", "POLY", NULL);
+ Tcl_SetErrorCode(interp, "TK", "CANVAS", "ITEM_INDEX", "POLY", NULL);
return TCL_ERROR;
}
@@ -1981,7 +1981,7 @@ PolygonToPostscript(
done:
(void) Tcl_RestoreInterpState(interp, interpState);
- Tcl_AppendResult(interp, Tcl_GetString(psObj), NULL);
+ Tcl_AppendObjToObj(Tcl_GetObjResult(interp), psObj);
Tcl_DecrRefCount(psObj);
return TCL_OK;
diff --git a/generic/tkCanvText.c b/generic/tkCanvText.c
index d972d48..eb8dfe3 100644
--- a/generic/tkCanvText.c
+++ b/generic/tkCanvText.c
@@ -1410,7 +1410,7 @@ GetTextIndex(
badIndex:
Tcl_SetObjResult(interp, Tcl_ObjPrintf("bad index \"%s\"", string));
- Tcl_SetErrorCode(interp, "TK", "CANVAS", "ITEMINDEX", "TEXT", NULL);
+ Tcl_SetErrorCode(interp, "TK", "CANVAS", "ITEM_INDEX", "TEXT", NULL);
return TCL_ERROR;
}
return TCL_OK;
@@ -1641,7 +1641,7 @@ TextToPostscript(
done:
(void) Tcl_RestoreInterpState(interp, interpState);
- Tcl_AppendResult(interp, Tcl_GetString(psObj), NULL);
+ Tcl_AppendObjToObj(Tcl_GetObjResult(interp), psObj);
Tcl_DecrRefCount(psObj);
return TCL_OK;
diff --git a/generic/tkCanvWind.c b/generic/tkCanvWind.c
index 7ca7c9d..f183b35 100644
--- a/generic/tkCanvWind.c
+++ b/generic/tkCanvWind.c
@@ -904,7 +904,7 @@ CanvasPsWindow(
done:
if (result == TCL_OK) {
(void) Tcl_RestoreInterpState(interp, interpState);
- Tcl_AppendResult(interp, Tcl_GetString(psObj), NULL);
+ Tcl_AppendObjToObj(Tcl_GetObjResult(interp), psObj);
} else {
Tcl_DiscardInterpState(interpState);
}
diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c
index 97518f9..d6b6959 100644
--- a/generic/tkCanvas.c
+++ b/generic/tkCanvas.c
@@ -2317,7 +2317,7 @@ ConfigureCanvas(
if (argc2 != 4) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"bad scrollRegion \"%s\"", canvasPtr->regionString));
- Tcl_SetErrorCode(interp, "TK", "CANVAS", "SCROLLREGION", NULL);
+ Tcl_SetErrorCode(interp, "TK", "CANVAS", "SCROLL_REGION", NULL);
badRegion:
ckfree(canvasPtr->regionString);
ckfree(argv2);
diff --git a/generic/tkFont.c b/generic/tkFont.c
index 2e1ad01..2d74356 100644
--- a/generic/tkFont.c
+++ b/generic/tkFont.c
@@ -3325,7 +3325,7 @@ Tk_TextLayoutToPostscript(
}
}
Tcl_AppendToObj(psObj, ")]\n", -1);
- Tcl_AppendResult(interp, Tcl_GetString(psObj), NULL);
+ Tcl_AppendObjToObj(Tcl_GetObjResult(interp), psObj);
Tcl_DecrRefCount(psObj);
}
diff --git a/generic/tkGrab.c b/generic/tkGrab.c
index e825c7b..6a5fac6 100644
--- a/generic/tkGrab.c
+++ b/generic/tkGrab.c
@@ -552,7 +552,7 @@ Tk_Grab(
} else if (grabResult == GrabInvalidTime) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"grab failed: invalid time", -1));
- Tcl_SetErrorCode(interp, "TK", "GRAB", "BADTIME", NULL);
+ Tcl_SetErrorCode(interp, "TK", "GRAB", "BAD_TIME", NULL);
} else {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"grab failed for unknown reason (code %d)", grabResult));
diff --git a/generic/tkGrid.c b/generic/tkGrid.c
index 6c5bbc1..c11d342 100644
--- a/generic/tkGrid.c
+++ b/generic/tkGrid.c
@@ -403,7 +403,7 @@ Tk_GridObjCmd(
/* This should not happen */
Tcl_SetObjResult(interp, Tcl_NewStringObj("internal error in grid", -1));
- Tcl_SetErrorCode(interp, "TK", "UNREACHABLE", NULL);
+ Tcl_SetErrorCode(interp, "TK", "API_ABUSE", NULL);
return TCL_ERROR;
}
@@ -1004,7 +1004,7 @@ GridRowColumnConfigureCommand(
if (lObjc == 0) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf("no %s indices specified",
(slotType == COLUMN) ? "column" : "row"));
- Tcl_SetErrorCode(interp, "TK", "GRID", "NOINDEX", NULL);
+ Tcl_SetErrorCode(interp, "TK", "GRID", "NO_INDEX", NULL);
Tcl_DecrRefCount(listCopy);
return TCL_ERROR;
}
diff --git a/generic/tkImgBmap.c b/generic/tkImgBmap.c
index f2558db..f57db55 100644
--- a/generic/tkImgBmap.c
+++ b/generic/tkImgBmap.c
@@ -1224,7 +1224,7 @@ ImgBmapPostscript(
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"unable to generate postscript for bitmaps larger than 60000"
" pixels", -1));
- Tcl_SetErrorCode(interp, "TK", "IMAGE", "BITMAP", "OUTSIZE", NULL);
+ Tcl_SetErrorCode(interp, "TK", "CANVAS", "PS", "MEMLIMIT", NULL);
return TCL_ERROR;
}
@@ -1304,7 +1304,7 @@ ImgBmapPostscript(
*/
(void) Tcl_RestoreInterpState(interp, interpState);
- Tcl_AppendResult(interp, Tcl_GetString(psObj), NULL);
+ Tcl_AppendObjToObj(Tcl_GetObjResult(interp), psObj);
Tcl_DecrRefCount(psObj);
return TCL_OK;
diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c
index 3f25984..db59b86 100644
--- a/generic/tkImgPhoto.c
+++ b/generic/tkImgPhoto.c
@@ -575,7 +575,7 @@ ImgPhotoCmd(
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"coordinates for -from option extend outside source image",
-1));
- Tcl_SetErrorCode(interp, "TK", "PHOTO", "BAD_FROM", NULL);
+ Tcl_SetErrorCode(interp, "TK", "IMAGE", "PHOTO", "BAD_FROM", NULL);
return TCL_ERROR;
}
@@ -678,7 +678,7 @@ ImgPhotoCmd(
|| (options.fromY2 > masterPtr->height)) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"coordinates for -from option extend outside image", -1));
- Tcl_SetErrorCode(interp, "TK", "PHOTO", "BAD_FROM", NULL);
+ Tcl_SetErrorCode(interp, "TK", "IMAGE", "PHOTO", "BAD_FROM", NULL);
return TCL_ERROR;
}
@@ -793,7 +793,8 @@ ImgPhotoCmd(
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"%s get: coordinates out of range",
Tcl_GetString(objv[0])));
- Tcl_SetErrorCode(interp, "TK", "PHOTO", "COORDINATES", NULL);
+ Tcl_SetErrorCode(interp, "TK", "IMAGE", "PHOTO", "COORDINATES",
+ NULL);
return TCL_ERROR;
}
@@ -890,8 +891,8 @@ ImgPhotoCmd(
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"all elements of color list must have the same"
" number of elements", -1));
- Tcl_SetErrorCode(interp, "TK", "PHOTO", "NON_RECTANGULAR",
- NULL);
+ Tcl_SetErrorCode(interp, "TK", "IMAGE", "PHOTO",
+ "NON_RECTANGULAR", NULL);
break;
}
@@ -1009,7 +1010,7 @@ ImgPhotoCmd(
if (Tcl_IsSafe(interp)) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"can't get image from a file in a safe interpreter", -1));
- Tcl_SetErrorCode(interp, "TK", "PHOTO", "SAFE", NULL);
+ Tcl_SetErrorCode(interp, "TK", "IMAGE", "PHOTO", "SAFE", NULL);
return TCL_ERROR;
}
@@ -1050,7 +1051,7 @@ ImgPhotoCmd(
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"coordinates for -from option extend outside source image",
-1));
- Tcl_SetErrorCode(interp, "TK", "PHOTO", "BAD_FROM", NULL);
+ Tcl_SetErrorCode(interp, "TK", "IMAGE", "PHOTO", "BAD_FROM", NULL);
Tcl_Close(NULL, chan);
return TCL_ERROR;
}
@@ -1166,7 +1167,8 @@ ImgPhotoCmd(
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"%s transparency get: coordinates out of range",
Tcl_GetString(objv[0])));
- Tcl_SetErrorCode(interp, "TK", "PHOTO", "COORDINATES", NULL);
+ Tcl_SetErrorCode(interp, "TK", "IMAGE", "PHOTO", "COORDINATES",
+ NULL);
return TCL_ERROR;
}
@@ -1205,7 +1207,8 @@ ImgPhotoCmd(
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"%s transparency set: coordinates out of range",
Tcl_GetString(objv[0])));
- Tcl_SetErrorCode(interp, "TK", "PHOTO", "COORDINATES", NULL);
+ Tcl_SetErrorCode(interp, "TK", "IMAGE", "PHOTO", "COORDINATES",
+ NULL);
return TCL_ERROR;
}
@@ -1270,7 +1273,7 @@ ImgPhotoCmd(
if (Tcl_IsSafe(interp)) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"can't write image to a file in a safe interpreter", -1));
- Tcl_SetErrorCode(interp, "TK", "PHOTO", "SAFE", NULL);
+ Tcl_SetErrorCode(interp, "TK", "IMAGE", "PHOTO", "SAFE", NULL);
return TCL_ERROR;
}
@@ -1297,7 +1300,7 @@ ImgPhotoCmd(
|| (options.fromY2 > masterPtr->height)) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"coordinates for -from option extend outside image", -1));
- Tcl_SetErrorCode(interp, "TK", "PHOTO", "BAD_FROM", NULL);
+ Tcl_SetErrorCode(interp, "TK", "IMAGE", "PHOTO", "BAD_FROM", NULL);
return TCL_ERROR;
}
@@ -1677,20 +1680,20 @@ ParseSubcommandOptions(
oneValueRequired:
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"the \"%s\" option requires a value", expandedOption));
- Tcl_SetErrorCode(interp, "TK", "PHOTO", "MISSING_VALUE", NULL);
+ Tcl_SetErrorCode(interp, "TK", "IMAGE", "PHOTO", "MISSING_VALUE", NULL);
return TCL_ERROR;
manyValuesRequired:
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"the \"%s\" option requires one %s integer values",
expandedOption, (maxValues == 2) ? "or two": "to four"));
- Tcl_SetErrorCode(interp, "TK", "PHOTO", "MISSING_VALUE", NULL);
+ Tcl_SetErrorCode(interp, "TK", "IMAGE", "PHOTO", "MISSING_VALUE", NULL);
return TCL_ERROR;
numberOutOfRange:
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"value(s) for the %s option must be %s", expandedOption, needed));
- Tcl_SetErrorCode(interp, "TK", "PHOTO", "BAD_VALUE", NULL);
+ Tcl_SetErrorCode(interp, "TK", "IMAGE", "PHOTO", "BAD_VALUE", NULL);
return TCL_ERROR;
unknownOrAmbiguousOption:
@@ -1710,7 +1713,7 @@ ParseSubcommandOptions(
bit <<= 1;
}
Tcl_SetObjResult(interp, msgObj);
- Tcl_SetErrorCode(interp, "TK", "PHOTO", "BAD_OPTION", NULL);
+ Tcl_SetErrorCode(interp, "TK", "IMAGE", "PHOTO", "BAD_OPTION", NULL);
return TCL_ERROR;
}
@@ -1767,8 +1770,8 @@ ImgPhotoConfigureMaster(
ckfree(args);
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"value for \"-data\" missing", -1));
- Tcl_SetErrorCode(interp, "TK", "PHOTO", "MISSING_VALUE",
- NULL);
+ Tcl_SetErrorCode(interp, "TK", "IMAGE", "PHOTO",
+ "MISSING_VALUE", NULL);
return TCL_ERROR;
}
} else if ((args[j][1] == 'f') &&
@@ -1780,8 +1783,8 @@ ImgPhotoConfigureMaster(
ckfree(args);
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"value for \"-format\" missing", -1));
- Tcl_SetErrorCode(interp, "TK", "PHOTO", "MISSING_VALUE",
- NULL);
+ Tcl_SetErrorCode(interp, "TK", "IMAGE", "PHOTO",
+ "MISSING_VALUE", NULL);
return TCL_ERROR;
}
}
@@ -1894,7 +1897,7 @@ ImgPhotoConfigureMaster(
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"can't get image from a file in a safe interpreter",
-1));
- Tcl_SetErrorCode(interp, "TK", "PHOTO", "SAFE", NULL);
+ Tcl_SetErrorCode(interp, "TK", "IMAGE", "PHOTO", "SAFE", NULL);
goto errorExit;
}
@@ -2398,8 +2401,8 @@ MatchFileFormat(
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"-file option isn't supported for %s images",
formatString));
- Tcl_SetErrorCode(interp, "TK", "PHOTO", "NOT_FILE_FORMAT",
- NULL);
+ Tcl_SetErrorCode(interp, "TK", "IMAGE", "PHOTO",
+ "NOT_FILE_FORMAT", NULL);
return TCL_ERROR;
}
}
@@ -2432,8 +2435,8 @@ MatchFileFormat(
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"-file option isn't supported for %s images",
formatString));
- Tcl_SetErrorCode(interp, "TK", "PHOTO", "NOT_FILE_FORMAT",
- NULL);
+ Tcl_SetErrorCode(interp, "TK", "IMAGE", "PHOTO",
+ "NOT_FILE_FORMAT", NULL);
return TCL_ERROR;
}
}
@@ -2463,8 +2466,8 @@ MatchFileFormat(
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"couldn't recognize data in image file \"%s\"",
fileName));
- Tcl_SetErrorCode(interp, "TK", "PHOTO", "UNRECOGNIZED_DATA",
- NULL);
+ Tcl_SetErrorCode(interp, "TK", "PHOTO", "IMAGE",
+ "UNRECOGNIZED_DATA", NULL);
}
return TCL_ERROR;
}
@@ -2537,8 +2540,8 @@ MatchStringFormat(
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"-data option isn't supported for %s images",
formatString));
- Tcl_SetErrorCode(interp, "TK", "PHOTO", "NOT_DATA_FORMAT",
- NULL);
+ Tcl_SetErrorCode(interp, "TK", "IMAGE", "PHOTO",
+ "NOT_DATA_FORMAT", NULL);
return TCL_ERROR;
}
}
@@ -2564,8 +2567,8 @@ MatchStringFormat(
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"-data option isn't supported for %s images",
formatString));
- Tcl_SetErrorCode(interp, "TK", "PHOTO", "NOT_DATA_FORMAT",
- NULL);
+ Tcl_SetErrorCode(interp, "TK", "IMAGE", "PHOTO",
+ "NOT_DATA_FORMAT", NULL);
return TCL_ERROR;
}
}
@@ -2587,8 +2590,8 @@ MatchStringFormat(
} else {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"couldn't recognize image data", -1));
- Tcl_SetErrorCode(interp, "TK", "PHOTO", "UNRECOGNIZED_DATA",
- NULL);
+ Tcl_SetErrorCode(interp, "TK", "IMAGE", "PHOTO",
+ "UNRECOGNIZED_DATA", NULL);
}
return TCL_ERROR;
}
diff --git a/generic/tkListbox.c b/generic/tkListbox.c
index 355db5b..620f82f 100644
--- a/generic/tkListbox.c
+++ b/generic/tkListbox.c
@@ -875,7 +875,7 @@ ListboxWidgetObjCmd(
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"item number \"%s\" out of range",
Tcl_GetString(objv[2])));
- Tcl_SetErrorCode(interp, "TK", "LISTBOX", "ITEMIDX", NULL);
+ Tcl_SetErrorCode(interp, "TK", "LISTBOX", "ITEM_INDEX", NULL);
result = TCL_ERROR;
break;
}
@@ -912,7 +912,7 @@ ListboxWidgetObjCmd(
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"item number \"%s\" out of range",
Tcl_GetString(objv[2])));
- Tcl_SetErrorCode(interp, "TK", "LISTBOX", "ITEMIDX", NULL);
+ Tcl_SetErrorCode(interp, "TK", "LISTBOX", "ITEM_INDEX", NULL);
result = TCL_ERROR;
break;
}
diff --git a/generic/tkRectOval.c b/generic/tkRectOval.c
index c233c6c..a51ca33 100644
--- a/generic/tkRectOval.c
+++ b/generic/tkRectOval.c
@@ -1415,7 +1415,7 @@ RectOvalToPostscript(
*/
(void) Tcl_RestoreInterpState(interp, interpState);
- Tcl_AppendResult(interp, Tcl_GetString(psObj), NULL);
+ Tcl_AppendObjToObj(Tcl_GetObjResult(interp), psObj);
Tcl_DecrRefCount(psObj);
Tcl_DecrRefCount(pathObj);
return TCL_OK;
diff --git a/generic/tkText.c b/generic/tkText.c
index 28fa6cd..0970794 100644
--- a/generic/tkText.c
+++ b/generic/tkText.c
@@ -1262,7 +1262,7 @@ TextWidgetObjCmd(
if (objc > 3) {
name = Tcl_GetStringFromObj(objv[i], &length);
if (length > 1 && name[0] == '-') {
- if (strncmp("-displaychars", name, (unsigned)length)==0) {
+ if (strncmp("-displaychars", name, (unsigned) length) == 0) {
i++;
visible = 1;
name = Tcl_GetStringFromObj(objv[i], &length);
@@ -1669,7 +1669,7 @@ TextPeerCmd(
return TCL_ERROR;
}
- switch ((enum peerOptions)index) {
+ switch ((enum peerOptions) index) {
case PEER_CREATE:
if (objc < 4) {
Tcl_WrongNumArgs(interp, 3, objv, "pathName ?-option value ...?");
@@ -4620,7 +4620,7 @@ TextDumpCmd(
return TCL_ERROR;
}
str = Tcl_GetStringFromObj(objv[arg], &length);
- if (strncmp(str, "end", (unsigned)length) == 0) {
+ if (strncmp(str, "end", (unsigned) length) == 0) {
atEnd = 1;
}
}
@@ -5064,8 +5064,7 @@ TextEditCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- int index;
-
+ int index, setModified, oldModified;
static const char *const editOptionStrings[] = {
"modified", "redo", "reset", "separator", "undo", NULL
};
@@ -5088,39 +5087,36 @@ TextEditCmd(
if (objc == 3) {
Tcl_SetObjResult(interp,
Tcl_NewBooleanObj(textPtr->sharedTextPtr->isDirty));
+ return TCL_OK;
} else if (objc != 4) {
Tcl_WrongNumArgs(interp, 3, objv, "?boolean?");
return TCL_ERROR;
- } else {
- int setModified, oldModified;
-
- if (Tcl_GetBooleanFromObj(interp, objv[3],
- &setModified) != TCL_OK) {
- return TCL_ERROR;
- }
+ } else if (Tcl_GetBooleanFromObj(interp, objv[3],
+ &setModified) != TCL_OK) {
+ return TCL_ERROR;
+ }
- /*
- * Set or reset the dirty info, and trigger a Modified event.
- */
+ /*
+ * Set or reset the dirty info, and trigger a Modified event.
+ */
- setModified = setModified ? 1 : 0;
+ setModified = setModified ? 1 : 0;
- oldModified = textPtr->sharedTextPtr->isDirty;
- textPtr->sharedTextPtr->isDirty = setModified;
- if (setModified) {
- textPtr->sharedTextPtr->dirtyMode = TK_TEXT_DIRTY_FIXED;
- } else {
- textPtr->sharedTextPtr->dirtyMode = TK_TEXT_DIRTY_NORMAL;
- }
+ oldModified = textPtr->sharedTextPtr->isDirty;
+ textPtr->sharedTextPtr->isDirty = setModified;
+ if (setModified) {
+ textPtr->sharedTextPtr->dirtyMode = TK_TEXT_DIRTY_FIXED;
+ } else {
+ textPtr->sharedTextPtr->dirtyMode = TK_TEXT_DIRTY_NORMAL;
+ }
- /*
- * Only issue the <<Modified>> event if the flag actually changed.
- * However, degree of modified-ness doesn't matter. [Bug 1799782]
- */
+ /*
+ * Only issue the <<Modified>> event if the flag actually changed.
+ * However, degree of modified-ness doesn't matter. [Bug 1799782]
+ */
- if ((!oldModified) != (!setModified)) {
- GenerateModifiedEvent(textPtr);
- }
+ if ((!oldModified) != (!setModified)) {
+ GenerateModifiedEvent(textPtr);
}
break;
case EDIT_REDO:
@@ -5215,11 +5211,10 @@ TextGetText(
if (TkTextIndexCmp(indexPtr1, indexPtr2) < 0) {
while (1) {
- int offset, last;
- TkTextSegment *segPtr;
+ int offset;
+ TkTextSegment *segPtr = TkTextIndexToSeg(&tmpIndex, &offset);
+ int last = segPtr->size, last2;
- segPtr = TkTextIndexToSeg(&tmpIndex, &offset);
- last = segPtr->size;
if (tmpIndex.linePtr == indexPtr2->linePtr) {
/*
* The last line that was requested must be handled carefully,
@@ -5229,21 +5224,17 @@ TextGetText(
if (indexPtr2->byteIndex == tmpIndex.byteIndex) {
break;
- } else {
- int last2 = indexPtr2->byteIndex - tmpIndex.byteIndex
- + offset;
-
- if (last2 < last) {
- last = last2;
- }
}
- }
- if (segPtr->typePtr == &tkTextCharType) {
- if (!visibleOnly || !TkTextIsElided(textPtr,&tmpIndex,NULL)) {
- Tcl_AppendToObj(resultPtr, segPtr->body.chars + offset,
- last - offset);
+ last2 = indexPtr2->byteIndex - tmpIndex.byteIndex + offset;
+ if (last2 < last) {
+ last = last2;
}
}
+ if (segPtr->typePtr == &tkTextCharType &&
+ !(visibleOnly && TkTextIsElided(textPtr,&tmpIndex,NULL))){
+ Tcl_AppendToObj(resultPtr, segPtr->body.chars + offset,
+ last - offset);
+ }
TkTextIndexForwBytes(textPtr, &tmpIndex, last-offset, &tmpIndex);
}
}
@@ -5271,7 +5262,10 @@ static void
GenerateModifiedEvent(
TkText *textPtr) /* Information about text widget. */
{
- union {XEvent general; XVirtualEvent virtual;} event;
+ union {
+ XEvent general;
+ XVirtualEvent virtual;
+ } event;
Tk_MakeWindowExist(textPtr->tkwin);
@@ -5407,14 +5401,9 @@ SearchPerform(
* wrap when given a negative search range).
*/
- if (searchSpecPtr->backwards) {
- if (TkTextIndexCmp(indexFromPtr, indexToPtr) == -1) {
- return TCL_OK;
- }
- } else {
- if (TkTextIndexCmp(indexFromPtr, indexToPtr) == 1) {
- return TCL_OK;
- }
+ if (TkTextIndexCmp(indexFromPtr, indexToPtr) ==
+ (searchSpecPtr->backwards ? -1 : 1)) {
+ return TCL_OK;
}
if (searchSpecPtr->lineIndexProc(interp, toPtr, searchSpecPtr,
@@ -5721,7 +5710,7 @@ SearchCore(
}
while (p >= startOfLine + firstOffset) {
if (p[0] == c && !strncmp(p, pattern,
- (unsigned)matchLength)) {
+ (unsigned) matchLength)) {
goto backwardsMatch;
}
p--;
@@ -5750,7 +5739,7 @@ SearchCore(
*/
p = startOfLine + lastOffset - firstNewLine - 1;
- if (strncmp(p, pattern, (unsigned)(firstNewLine + 1))) {
+ if (strncmp(p, pattern, (unsigned) firstNewLine + 1)) {
/*
* No match.
*/
diff --git a/generic/tkTextIndex.c b/generic/tkTextIndex.c
index 4fe97eb..b04eef2 100644
--- a/generic/tkTextIndex.c
+++ b/generic/tkTextIndex.c
@@ -151,7 +151,7 @@ SetTextIndexFromAny(
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"can't convert value to textindex except via"
" TkTextGetIndexFromObj API", -1));
- Tcl_SetErrorCode(interp, "TK", "ILLEGAL_API_USAGE", NULL);
+ Tcl_SetErrorCode(interp, "TK", "API_ABUSE", NULL);
return TCL_ERROR;
}
diff --git a/generic/tkTrig.c b/generic/tkTrig.c
index 5f4d267..3da1e5c 100644
--- a/generic/tkTrig.c
+++ b/generic/tkTrig.c
@@ -1441,7 +1441,7 @@ TkMakeBezierPostscript(
control[6], Tk_CanvasPsY(canvas, control[7]));
}
- Tcl_AppendResult(interp, Tcl_GetString(psObj), NULL);
+ Tcl_AppendObjToObj(Tcl_GetObjResult(interp), psObj);
Tcl_DecrRefCount(psObj);
}
@@ -1552,7 +1552,7 @@ TkMakeRawCurvePostscript(
}
}
- Tcl_AppendResult(interp, Tcl_GetString(psObj), NULL);
+ Tcl_AppendObjToObj(Tcl_GetObjResult(interp), psObj);
Tcl_DecrRefCount(psObj);
}
diff --git a/macosx/tkMacOSXEmbed.c b/macosx/tkMacOSXEmbed.c
index 8499faa..a154e09 100644
--- a/macosx/tkMacOSXEmbed.c
+++ b/macosx/tkMacOSXEmbed.c
@@ -210,7 +210,7 @@ TkpUseWindow(
if (winPtr->window != None) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"can't modify container after widget is created", -1));
- Tcl_SetErrorCode(interp, "TK", "EMBED", "CREATION", NULL);
+ Tcl_SetErrorCode(interp, "TK", "EMBED", "POST_CREATE", NULL);
return TCL_ERROR;
}
@@ -228,14 +228,12 @@ TkpUseWindow(
}
usePtr = (TkWindow *) Tk_IdToWindow(winPtr->display, (Window) parent);
- if (usePtr != NULL) {
- if (!(usePtr->flags & TK_CONTAINER)) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "window \"%s\" doesn't have -container option set",
- usePtr->pathName));
- Tcl_SetErrorCode(interp, "TK", "EMBED", "TARGET", NULL);
- return TCL_ERROR;
- }
+ if (usePtr != NULL && !(usePtr->flags & TK_CONTAINER)) {
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf(
+ "window \"%s\" doesn't have -container option set",
+ usePtr->pathName));
+ Tcl_SetErrorCode(interp, "TK", "EMBED", "CONTAINER", NULL);
+ return TCL_ERROR;
}
/*
diff --git a/unix/tkUnixCursor.c b/unix/tkUnixCursor.c
index 3103cc1..8a19c7b 100644
--- a/unix/tkUnixCursor.c
+++ b/unix/tkUnixCursor.c
@@ -277,7 +277,7 @@ TkGetCursorByName(
if (TkParseColor(display, Tk_Colormap(tkwin), argv[1], &fg) == 0) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"invalid color name \"%s\"", argv[1]));
- Tcl_SetErrorCode(interp, "TK", "CURSOR", "FGCOL", NULL);
+ Tcl_SetErrorCode(interp, "TK", "CURSOR", "COLOR", NULL);
goto cleanup;
}
if (argc == 2) {
@@ -287,7 +287,7 @@ TkGetCursorByName(
&bg) == 0) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"invalid color name \"%s\"", argv[2]));
- Tcl_SetErrorCode(interp, "TK", "CURSOR", "BGCOL", NULL);
+ Tcl_SetErrorCode(interp, "TK", "CURSOR", "COLOR", NULL);
goto cleanup;
}
}
@@ -428,7 +428,7 @@ CreateCursorFromTableOrFile(
if (data == NULL) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"error reading bitmap data for \"%s\"", argv[0]));
- Tcl_SetErrorCode(interp, "TK", "CURSOR", "BITMAPDATA", NULL);
+ Tcl_SetErrorCode(interp, "TK", "CURSOR", "BITMAP_DATA", NULL);
goto cleanup;
}
@@ -440,7 +440,7 @@ CreateCursorFromTableOrFile(
&source, &xHot, &yHot) != BitmapSuccess) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"cleanup reading bitmap file \"%s\"", &argv[0][1]));
- Tcl_SetErrorCode(interp, "TK", "CURSOR", "BITMAPFILE", NULL);
+ Tcl_SetErrorCode(interp, "TK", "CURSOR", "BITMAP_FILE", NULL);
goto cleanup;
}
}
@@ -469,7 +469,7 @@ CreateCursorFromTableOrFile(
if (TkParseColor(display, Tk_Colormap(tkwin), fgColor, &fg) == 0) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"invalid color name \"%s\"", fgColor));
- Tcl_SetErrorCode(interp, "TK", "CURSOR", "FGCOL", NULL);
+ Tcl_SetErrorCode(interp, "TK", "CURSOR", "COLOR", NULL);
goto cleanup;
}
if (inTkTable) {
@@ -489,13 +489,13 @@ CreateCursorFromTableOrFile(
if (TkParseColor(display, Tk_Colormap(tkwin), fgColor, &fg) == 0) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"invalid color name \"%s\"", fgColor));
- Tcl_SetErrorCode(interp, "TK", "CURSOR", "FGCOL", NULL);
+ Tcl_SetErrorCode(interp, "TK", "CURSOR", "COLOR", NULL);
goto cleanup;
}
if (TkParseColor(display, Tk_Colormap(tkwin), bgColor, &bg) == 0) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"invalid color name \"%s\"", bgColor));
- Tcl_SetErrorCode(interp, "TK", "CURSOR", "BGCOL", NULL);
+ Tcl_SetErrorCode(interp, "TK", "CURSOR", "COLOR", NULL);
goto cleanup;
}
}
@@ -526,7 +526,7 @@ CreateCursorFromTableOrFile(
if (data == NULL) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"error reading bitmap mask data for \"%s\"", argv[0]));
- Tcl_SetErrorCode(interp, "TK", "CURSOR", "MASKDATA", -1);
+ Tcl_SetErrorCode(interp, "TK", "CURSOR", "MASK_DATA", NULL);
goto cleanup;
}
@@ -540,7 +540,7 @@ CreateCursorFromTableOrFile(
&mask, &dummy1, &dummy2) != BitmapSuccess) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"cleanup reading bitmap file \"%s\"", argv[1]));
- Tcl_SetErrorCode(interp, "TK", "CURSOR", "MASKFILE", -1);
+ Tcl_SetErrorCode(interp, "TK", "CURSOR", "MASK_FILE", NULL);
goto cleanup;
}
}
@@ -548,7 +548,7 @@ CreateCursorFromTableOrFile(
if ((maskWidth != width) || (maskHeight != height)) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"source and mask bitmaps have different sizes", -1));
- Tcl_SetErrorCode(interp, "TK", "CURSOR", "SIZE_MATCH", -1);
+ Tcl_SetErrorCode(interp, "TK", "CURSOR", "SIZE_MATCH", NULL);
goto cleanup;
}
diff --git a/unix/tkUnixEmbed.c b/unix/tkUnixEmbed.c
index d94157c..8a4c368 100644
--- a/unix/tkUnixEmbed.c
+++ b/unix/tkUnixEmbed.c
@@ -121,14 +121,12 @@ TkpUseWindow(
parent = (Window) id;
usePtr = (TkWindow *) Tk_IdToWindow(winPtr->display, parent);
- if (usePtr != NULL) {
- if (!(usePtr->flags & TK_CONTAINER)) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "window \"%s\" doesn't have -container option set",
- usePtr->pathName));
- Tcl_SetErrorCode(interp, "TK", "EMBED", "CONTAINER", NULL);
- return TCL_ERROR;
- }
+ if (usePtr != NULL && !(usePtr->flags & TK_CONTAINER)) {
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf(
+ "window \"%s\" doesn't have -container option set",
+ usePtr->pathName));
+ Tcl_SetErrorCode(interp, "TK", "EMBED", "CONTAINER", NULL);
+ return TCL_ERROR;
}
/*
@@ -150,7 +148,7 @@ TkpUseWindow(
if (interp != NULL) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"couldn't create child of window \"%s\"", string));
- Tcl_SetErrorCode(interp, "TK", "EMBED", "CHILD", NULL);
+ Tcl_SetErrorCode(interp, "TK", "EMBED", "NO_TARGET", NULL);
}
return TCL_ERROR;
}
diff --git a/unix/tkUnixWm.c b/unix/tkUnixWm.c
index 0142768..e63da88 100644
--- a/unix/tkUnixWm.c
+++ b/unix/tkUnixWm.c
@@ -2208,31 +2208,29 @@ WmIconifyCmd(
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"can't iconify \"%s\": override-redirect flag is set",
winPtr->pathName));
- Tcl_SetErrorCode(interp, "TK", "WM", "CANNOT_ICONIFY",
- "OVERRIDE_REDIRECT", NULL);
+ Tcl_SetErrorCode(interp, "TK", "WM", "ICONIFY", "OVERRIDE_REDIRECT",
+ NULL);
return TCL_ERROR;
}
if (wmPtr->masterPtr != NULL) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"can't iconify \"%s\": it is a transient",
winPtr->pathName));
- Tcl_SetErrorCode(interp, "TK", "WM", "CANNOT_ICONIFY", "TRANSIENT",
- NULL);
+ Tcl_SetErrorCode(interp, "TK", "WM", "ICONIFY", "TRANSIENT", NULL);
return TCL_ERROR;
}
if (wmPtr->iconFor != NULL) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"can't iconify %s: it is an icon for %s",
winPtr->pathName, Tk_PathName(wmPtr->iconFor)));
- Tcl_SetErrorCode(interp, "TK", "WM", "CANNOT_ICONIFY", "ICON", NULL);
+ Tcl_SetErrorCode(interp, "TK", "WM", "ICONIFY", "ICON", NULL);
return TCL_ERROR;
}
if (winPtr->flags & TK_EMBEDDED) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"can't iconify %s: it is an embedded window",
winPtr->pathName));
- Tcl_SetErrorCode(interp, "TK", "WM", "CANNOT_ICONIFY", "EMBEDDED",
- NULL);
+ Tcl_SetErrorCode(interp, "TK", "WM", "ICONIFY", "EMBEDDED", NULL);
return TCL_ERROR;
}
if (TkpWmSetState(winPtr, IconicState) == 0) {
diff --git a/win/tkWinDialog.c b/win/tkWinDialog.c
index 7f96ec2..c64df72 100644
--- a/win/tkWinDialog.c
+++ b/win/tkWinDialog.c
@@ -896,7 +896,8 @@ GetFileName(
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"invalid filename \"%s\"",
ConvertExternalFilename(ofn.lpstrFile, &ds)));
- Tcl_SetErrorCode(interp, "TK", "FILEDIALOG", "INVALIDFILENAME", NULL);
+ Tcl_SetErrorCode(interp, "TK", "FILEDIALOG", "INVALID_FILENAME",
+ NULL);
Tcl_DStringFree(&ds);
} else {
result = TCL_OK;
diff --git a/win/tkWinEmbed.c b/win/tkWinEmbed.c
index 7ea4222..a908a1f 100644
--- a/win/tkWinEmbed.c
+++ b/win/tkWinEmbed.c
@@ -285,13 +285,13 @@ TkpUseWindow(
if (!SendMessage(hwnd, TK_INFO, TK_CONTAINER_ISAVAILABLE, 0)) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"The container is already in use", -1));
- Tcl_SetErrorCode(interp, "TK", "EMBED", "USED", NULL);
+ Tcl_SetErrorCode(interp, "TK", "EMBED", "IN_USE", NULL);
return TCL_ERROR;
}
} else if (id == -PTR2INT(hwnd)) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"the window to use is not a Tk container", -1));
- Tcl_SetErrorCode(interp, "TK", "EMBED", "NOT", NULL);
+ Tcl_SetErrorCode(interp, "TK", "EMBED", "CONTAINER", NULL);
return TCL_ERROR;
} else {
/*
diff --git a/win/tkWinWm.c b/win/tkWinWm.c
index 989fa3f..da65a65 100644
--- a/win/tkWinWm.c
+++ b/win/tkWinWm.c
@@ -4120,8 +4120,7 @@ WmIconifyCmd(
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"can't iconify %s: the container does not support the request",
winPtr->pathName));
- Tcl_SetErrorCode(interp, "TK", "WM", "CANNOT_ICONIFY", "EMBEDDED",
- NULL);
+ Tcl_SetErrorCode(interp, "TK", "WM", "ICONIFY", "EMBEDDED", NULL);
return TCL_ERROR;
}
}
@@ -4129,23 +4128,22 @@ WmIconifyCmd(
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"can't iconify \"%s\": override-redirect flag is set",
winPtr->pathName));
- Tcl_SetErrorCode(interp, "TK", "WM", "CANNOT_ICONIFY",
- "OVERRIDE_REDIRECT", NULL);
+ Tcl_SetErrorCode(interp, "TK", "WM", "ICONIFY", "OVERRIDE_REDIRECT",
+ NULL);
return TCL_ERROR;
}
if (wmPtr->masterPtr != NULL) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"can't iconify \"%s\": it is a transient",
winPtr->pathName));
- Tcl_SetErrorCode(interp, "TK", "WM", "CANNOT_ICONIFY", "TRANSIENT",
- NULL);
+ Tcl_SetErrorCode(interp, "TK", "WM", "ICONIFY", "TRANSIENT", NULL);
return TCL_ERROR;
}
if (wmPtr->iconFor != NULL) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"can't iconify %s: it is an icon for %s",
winPtr->pathName, Tk_PathName(wmPtr->iconFor)));
- Tcl_SetErrorCode(interp, "TK", "WM", "CANNOT_ICONIFY", "ICON", NULL);
+ Tcl_SetErrorCode(interp, "TK", "WM", "ICONIFY", "ICON", NULL);
return TCL_ERROR;
}
TkpWmSetState(winPtr, IconicState);
diff --git a/win/ttkWinXPTheme.c b/win/ttkWinXPTheme.c
index a343216..8666b65 100644
--- a/win/ttkWinXPTheme.c
+++ b/win/ttkWinXPTheme.c
@@ -1119,7 +1119,7 @@ Ttk_CreateVsapiElement(
if (objc < 2) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"missing required arguments 'class' and/or 'partId'", -1));
- Tcl_SetErrorCode(interp, "TCL", "VSAPI", "REQUIRED", NULL);
+ Tcl_SetErrorCode(interp, "TTK", "VSAPI", "REQUIRED", NULL);
return TCL_ERROR;
}
@@ -1137,7 +1137,7 @@ Ttk_CreateVsapiElement(
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"Missing value for \"%s\".",
Tcl_GetString(objv[i])));
- Tcl_SetErrorCode(interp, "TCL", "VSAPI", "MISSING", NULL);
+ Tcl_SetErrorCode(interp, "TTK", "VSAPI", "MISSING", NULL);
return TCL_ERROR;
}
if (Tcl_GetIndexFromObj(interp, objv[i], optionStrings,