summaryrefslogtreecommitdiffstats
path: root/generic
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)
commit2ead17659538d3181771fbbc11b878b2aefa749c (patch)
tree57401f7210c6e05cfdc7c3b9fa8101309ed119e4 /generic
parent18cbefcbadf4e0022be3cc511050403672662161 (diff)
downloadtk-2ead17659538d3181771fbbc11b878b2aefa749c.zip
tk-2ead17659538d3181771fbbc11b878b2aefa749c.tar.gz
tk-2ead17659538d3181771fbbc11b878b2aefa749c.tar.bz2
Eliminate all usage of functions Tcl_VarEval (deprecated) and Tcl_Eval (to the prefered Tcl_EvalEx).
Diffstat (limited to 'generic')
-rw-r--r--generic/tkCanvPs.c2
-rw-r--r--generic/tkCanvas.c17
-rw-r--r--generic/tkEntry.c11
-rw-r--r--generic/tkListbox.c22
-rw-r--r--generic/tkMenu.c2
-rw-r--r--generic/tkText.c17
-rw-r--r--generic/tkTextDisp.c16
-rw-r--r--generic/tkWindow.c14
8 files changed, 80 insertions, 21 deletions
diff --git a/generic/tkCanvPs.c b/generic/tkCanvPs.c
index 0c7b0dd..70fc457 100644
--- a/generic/tkCanvPs.c
+++ b/generic/tkCanvPs.c
@@ -193,7 +193,7 @@ TkCanvPostscriptCmd(
* such.
*/
- result = Tcl_Eval(interp, "::tk::ensure_psenc_is_loaded");
+ result = Tcl_EvalEx(interp, "::tk::ensure_psenc_is_loaded", -1, 0);
if (result != TCL_OK) {
return result;
}
diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c
index 23d8e04..8e14852 100644
--- a/generic/tkCanvas.c
+++ b/generic/tkCanvas.c
@@ -5540,6 +5540,7 @@ CanvasUpdateScrollbars(
int xOrigin, yOrigin, inset, width, height;
int scrollX1, scrollX2, scrollY1, scrollY2;
char *xScrollCmd, *yScrollCmd;
+ Tcl_DString buf;
/*
* Save all the relevant values from the canvasPtr, because it might be
@@ -5570,8 +5571,12 @@ CanvasUpdateScrollbars(
Tcl_Obj *fractions = ScrollFractions(xOrigin + inset,
xOrigin + width - inset, scrollX1, scrollX2);
- result = Tcl_VarEval(interp, xScrollCmd," ",Tcl_GetString(fractions),
- NULL);
+ Tcl_DStringInit(&buf);
+ Tcl_DStringAppend(&buf, xScrollCmd, -1);
+ Tcl_DStringAppend(&buf, " ", -1);
+ Tcl_DStringAppend(&buf, Tcl_GetString(fractions), -1);
+ result = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), -1, 0);
+ Tcl_DStringFree(&buf);
Tcl_DecrRefCount(fractions);
if (result != TCL_OK) {
Tcl_BackgroundException(interp, result);
@@ -5584,8 +5589,12 @@ CanvasUpdateScrollbars(
Tcl_Obj *fractions = ScrollFractions(yOrigin + inset,
yOrigin + height - inset, scrollY1, scrollY2);
- result = Tcl_VarEval(interp, yScrollCmd," ",Tcl_GetString(fractions),
- NULL);
+ Tcl_DStringInit(&buf);
+ Tcl_DStringAppend(&buf, yScrollCmd, -1);
+ Tcl_DStringAppend(&buf, " ", -1);
+ Tcl_DStringAppend(&buf, Tcl_GetString(fractions), -1);
+ result = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), -1, 0);
+ Tcl_DStringFree(&buf);
Tcl_DecrRefCount(fractions);
if (result != TCL_OK) {
Tcl_BackgroundException(interp, result);
diff --git a/generic/tkEntry.c b/generic/tkEntry.c
index eb94cbd..1244273 100644
--- a/generic/tkEntry.c
+++ b/generic/tkEntry.c
@@ -2939,6 +2939,7 @@ EntryUpdateScrollbar(
int code;
double first, last;
Tcl_Interp *interp;
+ Tcl_DString buf;
if (entryPtr->scrollCmd == NULL) {
return;
@@ -2949,8 +2950,14 @@ EntryUpdateScrollbar(
EntryVisibleRange(entryPtr, &first, &last);
Tcl_PrintDouble(NULL, first, firstStr);
Tcl_PrintDouble(NULL, last, lastStr);
- code = Tcl_VarEval(interp, entryPtr->scrollCmd, " ", firstStr, " ",
- lastStr, NULL);
+ Tcl_DStringInit(&buf);
+ Tcl_DStringAppend(&buf, entryPtr->scrollCmd, -1);
+ Tcl_DStringAppend(&buf, " ", -1);
+ Tcl_DStringAppend(&buf, firstStr, -1);
+ Tcl_DStringAppend(&buf, " ", -1);
+ Tcl_DStringAppend(&buf, lastStr, -1);
+ code = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), -1, 0);
+ Tcl_DStringFree(&buf);
if (code != TCL_OK) {
Tcl_AppendObjToErrorInfo(interp, Tcl_ObjPrintf(
"\n (horizontal scrolling command executed by %s)",
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)");
diff --git a/generic/tkMenu.c b/generic/tkMenu.c
index 267acd7..8f8a176 100644
--- a/generic/tkMenu.c
+++ b/generic/tkMenu.c
@@ -1061,7 +1061,7 @@ TkInvokeMenu(
Tcl_DStringInit(&ds);
Tcl_DStringAppend(&ds, "tk::TearOffMenu ", -1);
Tcl_DStringAppend(&ds, Tk_PathName(menuPtr->tkwin), -1);
- result = Tcl_Eval(interp, Tcl_DStringValue(&ds));
+ result = Tcl_EvalEx(interp, Tcl_DStringValue(&ds), -1, 0);
Tcl_DStringFree(&ds);
} else if ((mePtr->type == CHECK_BUTTON_ENTRY)
&& (mePtr->namePtr != NULL)) {
diff --git a/generic/tkText.c b/generic/tkText.c
index b36b136..2c7eec3 100644
--- a/generic/tkText.c
+++ b/generic/tkText.c
@@ -4941,9 +4941,20 @@ DumpSegment(
return 0;
} else {
int oldStateEpoch = TkBTreeEpoch(textPtr->sharedTextPtr->tree);
-
- Tcl_VarEval(interp, Tcl_GetString(command), " ", Tcl_GetString(tuple),
- NULL);
+ Tcl_DString buf;
+ int code;
+
+ Tcl_DStringInit(&buf);
+ Tcl_DStringAppend(&buf, Tcl_GetString(command), -1);
+ Tcl_DStringAppend(&buf, " ", -1);
+ Tcl_DStringAppend(&buf, Tcl_GetString(tuple), -1);
+ code = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), -1, 0);
+ Tcl_DStringFree(&buf);
+ if (code != TCL_OK) {
+ Tcl_AddErrorInfo(interp,
+ "\n (segment dumping command executed by text)");
+ Tcl_BackgroundException(interp, code);
+ }
Tcl_DecrRefCount(tuple);
return ((textPtr->flags & DESTROYED) ||
TkBTreeEpoch(textPtr->sharedTextPtr->tree) != oldStateEpoch);
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)");
diff --git a/generic/tkWindow.c b/generic/tkWindow.c
index d20473f..734e7be 100644
--- a/generic/tkWindow.c
+++ b/generic/tkWindow.c
@@ -3142,7 +3142,7 @@ Initialize(
* path of the slave.
*/
- code = Tcl_Eval(master, Tcl_DStringValue(&ds));
+ code = Tcl_EvalEx(master, Tcl_DStringValue(&ds), -1, 0);
if (code != TCL_OK) {
/*
* We might want to transfer the error message or not. We don't.
@@ -3278,8 +3278,14 @@ Initialize(
*/
if (geometry != NULL) {
+ Tcl_DString buf;
+
Tcl_SetVar2(interp, "geometry", NULL, geometry, TCL_GLOBAL_ONLY);
- code = Tcl_VarEval(interp, "wm geometry . ", geometry, NULL);
+ Tcl_DStringInit(&buf);
+ Tcl_DStringAppend(&buf, "wm geometry . ", -1);
+ Tcl_DStringAppend(&buf, geometry, -1);
+ code = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), -1, 0);
+ Tcl_DStringFree(&buf);
if (code != TCL_OK) {
goto done;
}
@@ -3337,7 +3343,7 @@ Initialize(
* an alternate [tkInit] command before calling Tk_Init().
*/
- code = Tcl_Eval(interp,
+ code = Tcl_EvalEx(interp,
"if {[namespace which -command tkInit] eq \"\"} {\n\
proc tkInit {} {\n\
global tk_library tk_version tk_patchLevel\n\
@@ -3345,7 +3351,7 @@ Initialize(
tcl_findLibrary tk $tk_version $tk_patchLevel tk.tcl TK_LIBRARY tk_library\n\
}\n\
}\n\
-tkInit");
+tkInit", -1, 0);
}
if (code == TCL_OK) {
/*