summaryrefslogtreecommitdiffstats
path: root/generic/tkTextDisp.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2013-03-07 14:49:40 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2013-03-07 14:49:40 (GMT)
commit0e5747eb2704c1b05cd30ccdf45fdc070851d8e8 (patch)
tree57401f7210c6e05cfdc7c3b9fa8101309ed119e4 /generic/tkTextDisp.c
parent0aa90e499f40fc68f53c0e7e488a4bb2ee1de2c7 (diff)
downloadtk-0e5747eb2704c1b05cd30ccdf45fdc070851d8e8.zip
tk-0e5747eb2704c1b05cd30ccdf45fdc070851d8e8.tar.gz
tk-0e5747eb2704c1b05cd30ccdf45fdc070851d8e8.tar.bz2
Eliminate all usage of functions Tcl_VarEval (deprecated) and Tcl_Eval (to the prefered Tcl_EvalEx).
Diffstat (limited to 'generic/tkTextDisp.c')
-rw-r--r--generic/tkTextDisp.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c
index 454ccff..5bd69a3 100644
--- a/generic/tkTextDisp.c
+++ b/generic/tkTextDisp.c
@@ -6064,12 +6064,18 @@ GetXView(
if (textPtr->xScrollCmd != NULL) {
char buf1[TCL_DOUBLE_SPACE+1];
char buf2[TCL_DOUBLE_SPACE+1];
+ Tcl_DString buf;
buf1[0] = ' ';
buf2[0] = ' ';
Tcl_PrintDouble(NULL, first, buf1+1);
Tcl_PrintDouble(NULL, last, buf2+1);
- code = Tcl_VarEval(interp, textPtr->xScrollCmd, buf1, buf2, NULL);
+ Tcl_DStringInit(&buf);
+ Tcl_DStringAppend(&buf, textPtr->xScrollCmd, -1);
+ Tcl_DStringAppend(&buf, buf1, -1);
+ Tcl_DStringAppend(&buf, buf2, -1);
+ code = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), -1, 0);
+ Tcl_DStringFree(&buf);
if (code != TCL_OK) {
Tcl_AddErrorInfo(interp,
"\n (horizontal scrolling command executed by text)");
@@ -6346,12 +6352,18 @@ GetYView(
if (textPtr->yScrollCmd != NULL) {
char buf1[TCL_DOUBLE_SPACE+1];
char buf2[TCL_DOUBLE_SPACE+1];
+ Tcl_DString buf;
buf1[0] = ' ';
buf2[0] = ' ';
Tcl_PrintDouble(NULL, first, buf1+1);
Tcl_PrintDouble(NULL, last, buf2+1);
- code = Tcl_VarEval(interp, textPtr->yScrollCmd, buf1, buf2, NULL);
+ Tcl_DStringInit(&buf);
+ Tcl_DStringAppend(&buf, textPtr->yScrollCmd, -1);
+ Tcl_DStringAppend(&buf, buf1, -1);
+ Tcl_DStringAppend(&buf, buf2, -1);
+ code = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), -1, 0);
+ Tcl_DStringFree(&buf);
if (code != TCL_OK) {
Tcl_AddErrorInfo(interp,
"\n (vertical scrolling command executed by text)");