summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornijtmans@users.sourceforge.net <jan.nijtmans>2013-01-23 16:17:51 (GMT)
committernijtmans@users.sourceforge.net <jan.nijtmans>2013-01-23 16:17:51 (GMT)
commitcaf8929ddddeb69d70f4ae55509f57d08021799c (patch)
treedf7580ce8c29b9f37019edc81342941250583fe6
parent98d58ae725eb8ccb5c5967c77da67e6f52c46f92 (diff)
downloadtk-caf8929ddddeb69d70f4ae55509f57d08021799c.zip
tk-caf8929ddddeb69d70f4ae55509f57d08021799c.tar.gz
tk-caf8929ddddeb69d70f4ae55509f57d08021799c.tar.bz2
Eliminate use of deprecated Tcl_VarEval function from ttk.
-rw-r--r--generic/ttk/ttkScroll.c8
1 files changed, 7 insertions, 1 deletions
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;