summaryrefslogtreecommitdiffstats
path: root/generic/tkListbox.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/tkListbox.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/tkListbox.c')
-rw-r--r--generic/tkListbox.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/generic/tkListbox.c b/generic/tkListbox.c
index c5460f9..48287ee 100644
--- a/generic/tkListbox.c
+++ b/generic/tkListbox.c
@@ -3244,6 +3244,7 @@ ListboxUpdateVScrollbar(
double first, last;
int result;
Tcl_Interp *interp;
+ Tcl_DString buf;
if (listPtr->yScrollCmd == NULL) {
return;
@@ -3269,8 +3270,14 @@ ListboxUpdateVScrollbar(
interp = listPtr->interp;
Tcl_Preserve(interp);
- result = Tcl_VarEval(interp, listPtr->yScrollCmd, " ", firstStr, " ",
- lastStr, NULL);
+ Tcl_DStringInit(&buf);
+ Tcl_DStringAppend(&buf, listPtr->yScrollCmd, -1);
+ Tcl_DStringAppend(&buf, " ", -1);
+ Tcl_DStringAppend(&buf, firstStr, -1);
+ Tcl_DStringAppend(&buf, " ", -1);
+ Tcl_DStringAppend(&buf, lastStr, -1);
+ result = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), -1, 0);
+ Tcl_DStringFree(&buf);
if (result != TCL_OK) {
Tcl_AddErrorInfo(interp,
"\n (vertical scrolling command executed by listbox)");
@@ -3307,6 +3314,7 @@ ListboxUpdateHScrollbar(
int result, windowWidth;
double first, last;
Tcl_Interp *interp;
+ Tcl_DString buf;
if (listPtr->xScrollCmd == NULL) {
return;
@@ -3334,8 +3342,14 @@ ListboxUpdateHScrollbar(
interp = listPtr->interp;
Tcl_Preserve(interp);
- result = Tcl_VarEval(interp, listPtr->xScrollCmd, " ", firstStr, " ",
- lastStr, NULL);
+ Tcl_DStringInit(&buf);
+ Tcl_DStringAppend(&buf, listPtr->xScrollCmd, -1);
+ Tcl_DStringAppend(&buf, " ", -1);
+ Tcl_DStringAppend(&buf, firstStr, -1);
+ Tcl_DStringAppend(&buf, " ", -1);
+ Tcl_DStringAppend(&buf, lastStr, -1);
+ result = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), -1, 0);
+ Tcl_DStringFree(&buf);
if (result != TCL_OK) {
Tcl_AddErrorInfo(interp,
"\n (horizontal scrolling command executed by listbox)");