| 1 | --- visualization/nviz/src/draw.c 2008-12-19 21:29:59.000000000 +0100 |
| 2 | +++ visualization/nviz/src/draw.c.new 2012-12-24 18:19:41.000000000 +0100 |
| 3 | @@ -25,6 +25,22 @@ |
| 4 | |
| 5 | int auto_draw(Nv_data *, Tcl_Interp *); |
| 6 | |
| 7 | +int |
| 8 | +TkCopyAndGlobalEval( |
| 9 | + Tcl_Interp *interp, /* Interpreter in which to evaluate script. */ |
| 10 | + char *script) /* Script to evaluate. */ |
| 11 | +{ |
| 12 | + Tcl_DString buffer; |
| 13 | + int code; |
| 14 | + |
| 15 | + Tcl_DStringInit(&buffer); |
| 16 | + Tcl_DStringAppend(&buffer, script, -1); |
| 17 | + code = Tcl_EvalEx(interp, Tcl_DStringValue(&buffer), |
| 18 | + Tcl_DStringLength(&buffer), TCL_EVAL_GLOBAL); |
| 19 | + Tcl_DStringFree(&buffer); |
| 20 | + return code; |
| 21 | +} |
| 22 | + |
| 23 | /* this function is used as a hook to |
| 24 | * call a particular script when the |
| 25 | * cancel button is pressed during a draw |