summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2012-07-30 07:46:19 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2012-07-30 07:46:19 (GMT)
commitca5623894dd113cd5642189574cf6c104c64cad8 (patch)
tree7e57204b12abc171ad343d007edecaf1b17cdf09 /win
parent27b42b57118a651074b7f1fcc859fc4ae00090d0 (diff)
downloadtk-ca5623894dd113cd5642189574cf6c104c64cad8.zip
tk-ca5623894dd113cd5642189574cf6c104c64cad8.tar.gz
tk-ca5623894dd113cd5642189574cf6c104c64cad8.tar.bz2
Working towards making the error codes more consistent.
Diffstat (limited to 'win')
-rw-r--r--win/tkWinDialog.c3
-rw-r--r--win/tkWinEmbed.c4
-rw-r--r--win/tkWinWm.c12
-rw-r--r--win/ttkWinXPTheme.c4
4 files changed, 11 insertions, 12 deletions
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,