\HeaderA{tclServiceMode}{Allow Tcl events to be serviced or not}{tclServiceMode}
\keyword{misc}{tclServiceMode}
\begin{Description}\relax
This function controls or reports on the Tcl service mode,
i.e. whether Tcl will respond to events.
\end{Description}
\begin{Usage}
\begin{verbatim}
tclServiceMode(on = NULL)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{on}] (logical) Whether event servicing is turned on. 
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
If called with \code{on == NULL} (the default), no change is made.

Note that this blocks all Tcl/Tk activity, including for widgets from
other packages.  It may be better to manage mapping of windows individually.
\end{Details}
\begin{Value}
The value of the Tcl service mode before the call.
\end{Value}
\begin{Examples}
\begin{ExampleCode}
## see demo(tkcanvas) for an example
## Not run: 
    
    oldmode <- tclServiceMode(FALSE)
    # Do some work to create a nice picture.  Nothing will be displayed until...
    tclServiceMode(oldmode)
## End(Not run)
## another idea is to use tkwm.withdraw() ... tkwm.deiconify()
\end{ExampleCode}
\end{Examples}

