From 282f0f285bae5c21efe87f27db67df25709567fd Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 23 Jan 2013 16:17:51 +0000 Subject: Eliminate use of deprecated Tcl_VarEval function from ttk. --- generic/ttk/ttkScroll.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/generic/ttk/ttkScroll.c b/generic/ttk/ttkScroll.c index defe05a..b670540 100644 --- a/generic/ttk/ttkScroll.c +++ b/generic/ttk/ttkScroll.c @@ -78,6 +78,7 @@ static int UpdateScrollbar(Tcl_Interp *interp, ScrollHandle h) char arg1[TCL_DOUBLE_SPACE + 2]; char arg2[TCL_DOUBLE_SPACE + 2]; int code; + Tcl_DString buf; h->flags &= ~SCROLL_UPDATE_REQUIRED; @@ -88,9 +89,14 @@ static int UpdateScrollbar(Tcl_Interp *interp, ScrollHandle h) arg1[0] = arg2[0] = ' '; Tcl_PrintDouble(interp, (double)s->first / s->total, arg1+1); Tcl_PrintDouble(interp, (double)s->last / s->total, arg2+1); + Tcl_DStringInit(&buf); + Tcl_DStringAppend(&buf, s->scrollCmd, -1); + Tcl_DStringAppend(&buf, arg1, -1); + Tcl_DStringAppend(&buf, arg2, -1); Tcl_Preserve(corePtr); - code = Tcl_VarEval(interp, s->scrollCmd, arg1, arg2, NULL); + code = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), -1, TCL_EVAL_GLOBAL); + Tcl_DStringFree(&buf); if (WidgetDestroyed(corePtr)) { Tcl_Release(corePtr); return TCL_ERROR; -- cgit v0.12