summaryrefslogtreecommitdiffstats
path: root/generic/tkGet.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2024-01-24 12:03:06 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2024-01-24 12:03:06 (GMT)
commita9691e944874422823863ac020e3d905e554f2d3 (patch)
treebb7e9cde6e565206eca9691c47e6a8fab31b1806 /generic/tkGet.c
parent03582e574085bb1a722ddb42239db6116db7c66a (diff)
downloadtk-a9691e944874422823863ac020e3d905e554f2d3.zip
tk-a9691e944874422823863ac020e3d905e554f2d3.tar.gz
tk-a9691e944874422823863ac020e3d905e554f2d3.tar.bz2
Limit "screen distances" in error-messages to 50 characters (as was done sometimes, but not everywhere)
Diffstat (limited to 'generic/tkGet.c')
-rw-r--r--generic/tkGet.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/generic/tkGet.c b/generic/tkGet.c
index f96b566..dea28bf 100644
--- a/generic/tkGet.c
+++ b/generic/tkGet.c
@@ -601,8 +601,8 @@ Tk_GetScreenMM(
error:
if (interp != NULL) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "expected screen distance but got \"%s\"", string));
- Tcl_SetErrorCode(interp, "TK", "VALUE", "SCREEN_DISTANCE", NULL);
+ "expected screen distance or \"\" but got \"%.50s\"", string));
+ Tcl_SetErrorCode(interp, "TK", "VALUE", "PIXELS", NULL);
}
return TCL_ERROR;
}
@@ -713,9 +713,8 @@ TkGetDoublePixels(
}
if (!tkwin) {
if (interp != NULL) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "expected screen distance but got \"%s\"", string));
- Tcl_SetErrorCode(interp, "TK", "VALUE", "PIXELS", NULL);
+ Tcl_SetObjResult(interp, Tcl_NewStringObj("bad screen", -1));
+ Tcl_SetErrorCode(interp, "TK", "VALUE", "FRACTIONAL_PIXELS", NULL);
}
return TCL_ERROR;
}
@@ -731,7 +730,7 @@ TkGetDoublePixels(
if (interp != NULL) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"expected screen distance but got \"%s\"", string));
- Tcl_SetErrorCode(interp, "TK", "VALUE", "FRACTIONAL_PIXELS", NULL);
+ Tcl_SetErrorCode(interp, "TK", "VALUE", "PIXELS", NULL);
}
return TCL_ERROR;
}