diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2024-01-24 12:03:06 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2024-01-24 12:03:06 (GMT) |
commit | a9691e944874422823863ac020e3d905e554f2d3 (patch) | |
tree | bb7e9cde6e565206eca9691c47e6a8fab31b1806 /generic/tkGet.c | |
parent | 03582e574085bb1a722ddb42239db6116db7c66a (diff) | |
download | tk-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.c | 11 |
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; } |