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