diff options
author | hobbs <hobbs> | 2006-04-11 20:25:43 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2006-04-11 20:25:43 (GMT) |
commit | 2600629589b8f9cf57b07a2d72181baf490b476d (patch) | |
tree | d96e71196cf66086c15e363885b00aec99af72be | |
parent | 3fc95f6550df0f6fab7395e517071636a75b30f3 (diff) | |
download | tk-2600629589b8f9cf57b07a2d72181baf490b476d.zip tk-2600629589b8f9cf57b07a2d72181baf490b476d.tar.gz tk-2600629589b8f9cf57b07a2d72181baf490b476d.tar.bz2 |
* generic/tkBind.c (Tk_BindEvent, ChangeScreen): replace
Tcl_GlobalEval with more efficient Tcl_EvalEx.
-rw-r--r-- | generic/tkBind.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/generic/tkBind.c b/generic/tkBind.c index 978f8ee..5fd431d 100644 --- a/generic/tkBind.c +++ b/generic/tkBind.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkBind.c,v 1.28.2.2 2004/05/13 14:29:22 dgp Exp $ + * RCS: @(#) $Id: tkBind.c,v 1.28.2.3 2006/04/11 20:25:43 hobbs Exp $ */ #include "tkPort.h" @@ -1803,8 +1803,9 @@ Tk_BindEvent(bindingTable, eventPtr, tkwin, numObjects, objectPtr) ckfree((char *) psPtr); } } else { - code = Tcl_GlobalEval(interp, p); - p += strlen(p); + int len = (int) strlen(p); + code = Tcl_EvalEx(interp, p, len, TCL_EVAL_GLOBAL); + p += len; } p++; @@ -2715,7 +2716,8 @@ ChangeScreen(interp, dispName, screenIndex) Tcl_DStringAppend(&cmd, dispName, -1); sprintf(screen, ".%d", screenIndex); Tcl_DStringAppend(&cmd, screen, -1); - code = Tcl_GlobalEval(interp, Tcl_DStringValue(&cmd)); + code = Tcl_EvalEx(interp, Tcl_DStringValue(&cmd), Tcl_DStringLength(&cmd), + TCL_EVAL_GLOBAL); if (code != TCL_OK) { Tcl_AddErrorInfo(interp, "\n (changing screen in event binding)"); @@ -4667,7 +4669,7 @@ TkKeysymToString(keysym) * * TkCopyAndGlobalEval -- * - * This procedure makes a copy of a script then calls Tcl_GlobalEval + * This procedure makes a copy of a script then passes to Tcl * to evaluate it. It's used in situations where the execution of * a command may cause the original command string to be reallocated. * @@ -4692,7 +4694,8 @@ TkCopyAndGlobalEval(interp, script) Tcl_DStringInit(&buffer); Tcl_DStringAppend(&buffer, script, -1); - code = Tcl_GlobalEval(interp, Tcl_DStringValue(&buffer)); + code = Tcl_EvalEx(interp, Tcl_DStringValue(&buffer), + Tcl_DStringLength(&buffer), TCL_EVAL_GLOBAL); Tcl_DStringFree(&buffer); return code; } |