diff options
Diffstat (limited to 'macosx/tkMacOSXScale.c')
-rw-r--r-- | macosx/tkMacOSXScale.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/macosx/tkMacOSXScale.c b/macosx/tkMacOSXScale.c index a37029c..c5a6f76 100644 --- a/macosx/tkMacOSXScale.c +++ b/macosx/tkMacOSXScale.c @@ -76,7 +76,7 @@ TkScale * TkpCreateScale( Tk_Window tkwin) { - MacScale *macScalePtr = (MacScale *) ckalloc(sizeof(MacScale)); + MacScale *macScalePtr = ckalloc(sizeof(MacScale)); macScalePtr->scaleHandle = NULL; if (scaleActionProc == NULL) { @@ -154,6 +154,7 @@ TkpDisplayScale( MacDrawable *macDraw; SInt32 initialValue, minValue, maxValue; UInt16 numTicks; + Tcl_DString buf; #ifdef TK_MAC_DEBUG_SCALE TkMacOSXDbgMsg("TkpDisplayScale"); @@ -171,10 +172,15 @@ TkpDisplayScale( if ((scalePtr->flags & INVOKE_COMMAND) && (scalePtr->command != NULL)) { Tcl_Preserve((ClientData) interp); sprintf(string, scalePtr->format, scalePtr->value); - result = Tcl_VarEval(interp, scalePtr->command, " ", string, NULL); + Tcl_DStringInit(&buf); + Tcl_DStringAppend(&buf, scalePtr->command, -1); + Tcl_DStringAppend(&buf, " ", -1); + Tcl_DStringAppend(&buf, string, -1); + result = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), -1, 0); + Tcl_DStringFree(&buf); if (result != TCL_OK) { Tcl_AddErrorInfo(interp, "\n (command executed by scale)"); - Tcl_BackgroundError(interp); + Tcl_BackgroundException(interp, result); } Tcl_Release((ClientData) interp); } |