diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2015-11-19 20:46:40 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2015-11-19 20:46:40 (GMT) |
commit | f0e7b98adcaa0890c60fdf84c8e9753f8f903a53 (patch) | |
tree | 02b9115f94d1ef5680576bf60aa762861eefc229 /generic/tkTextDisp.c | |
parent | 8c6ac85de70a9f2ce13eecd5605fb55cfde6d911 (diff) | |
download | tk-f0e7b98adcaa0890c60fdf84c8e9753f8f903a53.zip tk-f0e7b98adcaa0890c60fdf84c8e9753f8f903a53.tar.gz tk-f0e7b98adcaa0890c60fdf84c8e9753f8f903a53.tar.bz2 |
First test-implementation of "$t yupdate -command <command>". TODO: more testcases and documentation
Diffstat (limited to 'generic/tkTextDisp.c')
-rw-r--r-- | generic/tkTextDisp.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index ff90520..d31d2f3 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -2942,9 +2942,20 @@ AsyncUpdateLineMetrics( /* * We have looped over all lines, so we're done. We must release our * refCount on the widget (the timer token was already set to NULL - * above). + * above). If there is a registered command, run that first. */ + if (textPtr->linesUpdatedCmd != NULL) { + Tcl_Preserve((ClientData)textPtr->interp); + int code = Tcl_EvalObjEx(textPtr->interp, textPtr->linesUpdatedCmd, TCL_EVAL_GLOBAL); + if (code != TCL_OK && code != TCL_CONTINUE + && code != TCL_BREAK) { + Tcl_AddErrorInfo(textPtr->interp, "\n (text yupdate)"); + Tcl_BackgroundError(textPtr->interp); + } + Tcl_Release((ClientData)textPtr->interp); + } + textPtr->refCount--; if (textPtr->refCount == 0) { ckfree((char *) textPtr); |