diff options
author | nijtmans@users.sourceforge.net <jan.nijtmans> | 2013-03-07 14:49:40 (GMT) |
---|---|---|
committer | nijtmans@users.sourceforge.net <jan.nijtmans> | 2013-03-07 14:49:40 (GMT) |
commit | 344c1523bf034a1798d5cc7aecd393eadeefd386 (patch) | |
tree | 57401f7210c6e05cfdc7c3b9fa8101309ed119e4 /unix/tkUnixScale.c | |
parent | fea564d9005f2bf8010e953b12bce3a10bbaef59 (diff) | |
download | tk-344c1523bf034a1798d5cc7aecd393eadeefd386.zip tk-344c1523bf034a1798d5cc7aecd393eadeefd386.tar.gz tk-344c1523bf034a1798d5cc7aecd393eadeefd386.tar.bz2 |
Eliminate all usage of functions Tcl_VarEval (deprecated) and Tcl_Eval (to the prefered Tcl_EvalEx).
Diffstat (limited to 'unix/tkUnixScale.c')
-rw-r--r-- | unix/tkUnixScale.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/unix/tkUnixScale.c b/unix/tkUnixScale.c index b156a74..cc33a27 100644 --- a/unix/tkUnixScale.c +++ b/unix/tkUnixScale.c @@ -537,6 +537,7 @@ TkpDisplayScale( int result; char string[PRINT_CHARS]; XRectangle drawnArea; + Tcl_DString buf; scalePtr->flags &= ~REDRAW_PENDING; if ((scalePtr->tkwin == NULL) || !Tk_IsMapped(scalePtr->tkwin)) { @@ -551,8 +552,12 @@ TkpDisplayScale( if ((scalePtr->flags & INVOKE_COMMAND) && (scalePtr->command != NULL)) { Tcl_Preserve(interp); sprintf(string, scalePtr->format, scalePtr->value); - result = Tcl_VarEval(interp, scalePtr->command, " ", string, - (char *) 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_BackgroundException(interp, result); |