\HeaderA{grid.frame}{Create a Frame for Packing Objects}{grid.frame}
\aliasA{frameGrob}{grid.frame}{frameGrob}
\keyword{dplot}{grid.frame}
\begin{Description}\relax
These functions, together with \code{grid.pack},
\code{grid.place}, \code{packGrob}, and \code{placeGrob} are part of a
GUI-builder-like interface to constructing graphical images.
The idea is that you create a frame with this function then
use \code{grid.pack} or whatever to pack/place objects into the frame.
\end{Description}
\begin{Usage}
\begin{verbatim}
grid.frame(layout=NULL, name=NULL, gp=gpar(), vp=NULL, draw=TRUE)
frameGrob(layout=NULL, name=NULL, gp=gpar(), vp=NULL)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{layout}] A Grid layout, or NULL. This can be used to initialise
the frame with a number of rows and columns, with initial widths
and heights, etc. 
\item[\code{name}] A character identifier. 
\item[\code{vp}] An object of class \code{viewport}, or NULL. 
\item[\code{gp}] An object of class \code{gpar};  typically the output from
a call to the function \code{gpar}.
\item[\code{draw}] Should the frame be drawn.  
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
Both functions create a frame grob (a graphical object describing a
frame), but only \code{grid.frame()}
draws the frame (and then only if \code{draw} is \code{TRUE}).
Nothing will actually be
drawn, but it will put the frame on the display list, which means
that the output will be dynamically updated as objects are packed
into the frame.  Possibly useful for debugging.
\end{Details}
\begin{Value}
A frame grob.  \code{grid.frame()} returns the value invisibly.
\end{Value}
\begin{Author}\relax
Paul Murrell
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{grid.pack}{grid.pack}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
grid.newpage()
grid.frame(name="gf", draw=TRUE)
grid.pack("gf", rectGrob(gp=gpar(fill="grey")))
grid.pack("gf", textGrob("hi there"), side="right")
\end{ExampleCode}
\end{Examples}

