[Rd] tclServiceMode: stop Tcl/Tk from updating

Duncan Murdoch murdoch at stats.uwo.ca
Sat Apr 23 17:21:29 CEST 2005


In Windows, Tcl/Tk programs running under the tcltk package can update
too frequently:  for exmaple, we might go through a long sequence of
operations to construct a complex display, and in Windows each addition
will be shown separately.

To work around this, I've added a function "tclServiceMode" which serves
as an R interface to the "Tcl_SetServiceMode" function in the TCL API.
Calling "tclServiceMode(on = FALSE)" will stop Tcl/Tk from responding to
any events (redraws in particular) until "tclServiceMode(on = TRUE)" is
called. As far as I know, events are queued, not lost, when handling is
turned off.

So far this function is only in R-devel, but I'll commit it to R-patched
the next chance I get.

Duncan Murdoch



More information about the R-devel mailing list