\HeaderA{grid.add}{Add a Grid Graphical Object}{grid.add}
\aliasA{addGrob}{grid.add}{addGrob}
\aliasA{setChildren}{grid.add}{setChildren}
\keyword{dplot}{grid.add}
\begin{Description}\relax
Add a grob to a gTree or a descendant of a gTree.
\end{Description}
\begin{Usage}
\begin{verbatim}
grid.add(gPath, child, strict = FALSE, grep = FALSE,
         global = FALSE, allDevices = FALSE, redraw = TRUE) 

addGrob(gTree, child, gPath = NULL, strict = FALSE, grep = FALSE,
        global = FALSE)

setChildren(x, children)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{gTree, x}] A gTree object.
\item[\code{gPath}] A gPath object. For \code{grid.add} this
specifies a gTree on the display list.  For \code{addGrob} this
specifies a descendant of the specified gTree. 
\item[\code{child}] A grob object. 
\item[\code{children}] A gList object. 
\item[\code{strict}] A boolean indicating whether the gPath must be
matched exactly. 
\item[\code{grep}] A boolean indicating whether the \code{gPath} should
be treated as a regular expression.  Values are recycled across
elements of the \code{gPath} (e.g., \code{c(TRUE, FALSE)} means
that every odd element of the \code{gPath} will be treated as
a regular expression).

\item[\code{global}] A boolean indicating whether the function should affect
just the first match of the \code{gPath}, or whether all matches
should be affected.

\item[\code{allDevices}] A boolean indicating whether all open devices
should
be searched for matches, or just the current device.
NOT YET IMPLEMENTED.

\item[\code{redraw}] A logical value to indicate whether to redraw the grob. 
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
\code{addGrob} copies the specified grob and returns a modified
grob.

\code{grid.add} destructively modifies a grob on the display list.
If \code{redraw}
is \code{TRUE} it then redraws everything to reflect the change.

\code{setChildren} is a basic function for setting all children
of a gTree at once (instead of repeated calls to \code{addGrob}).
\end{Details}
\begin{Value}
\code{addGrob} returns a grob object;  \code{grid.add} returns \code{NULL}.
\end{Value}
\begin{Author}\relax
Paul Murrell
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{grob}{grob}}, \code{\LinkA{getGrob}{getGrob}},
\code{\LinkA{addGrob}{addGrob}}, \code{\LinkA{removeGrob}{removeGrob}}.
\end{SeeAlso}

