summaryrefslogtreecommitdiffstats
path: root/generic/ttk/ttkState.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/ttk/ttkState.c')
-rw-r--r--generic/ttk/ttkState.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/generic/ttk/ttkState.c b/generic/ttk/ttkState.c
index a71ae21..c34b900 100644
--- a/generic/ttk/ttkState.c
+++ b/generic/ttk/ttkState.c
@@ -98,8 +98,9 @@ static int StateSpecSetFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr)
if (stateNames[j] == 0) {
if (interp) {
- Tcl_ResetResult(interp);
- Tcl_AppendResult(interp, "Invalid state name ", stateName,NULL);
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf(
+ "Invalid state name %s", stateName));
+ Tcl_SetErrorCode(interp, "TTK", "VALUE", "STATE", NULL);
}
return TCL_ERROR;
}
@@ -216,8 +217,8 @@ Tcl_Obj *Ttk_StateMapLookup(
return specs[j+1];
}
if (interp) {
- Tcl_ResetResult(interp);
- Tcl_AppendResult(interp, "No match in state map", NULL);
+ Tcl_SetObjResult(interp, Tcl_NewStringObj("No match in state map", -1));
+ Tcl_SetErrorCode(interp, "TTK", "STATE", "UNMATCHED", NULL);
}
return NULL;
}
@@ -240,10 +241,11 @@ Ttk_StateMap Ttk_GetStateMapFromObj(
return NULL;
if (nSpecs % 2 != 0) {
- if (interp)
- Tcl_SetResult(interp,
- "State map must have an even number of elements",
- TCL_STATIC);
+ if (interp) {
+ Tcl_SetObjResult(interp, Tcl_NewStringObj(
+ "State map must have an even number of elements", -1));
+ Tcl_SetErrorCode(interp, "TTK", "VALUE", "STATEMAP", NULL);
+ }
return 0;
}