grid.pack.html
5.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>R: Pack an Object within a Frame</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="../../R.css">
</head><body>
<table width="100%" summary="page for grid.pack {grid}"><tr><td>grid.pack {grid}</td><td align="right">R Documentation</td></tr></table>
<h2>Pack an Object within a Frame</h2>
<h3>Description</h3>
<p>
This functions, together with <code>grid.frame</code> and <code>frameGrob</code>
are part of a
GUI-builder-like interface to constructing graphical images.
The idea is that you create a frame with <code>grid.frame</code> or
<code>frameGrob</code> then
use this functions to pack objects into the frame.
</p>
<h3>Usage</h3>
<pre>
grid.pack(gPath, grob, redraw = TRUE, side = NULL,
row = NULL, row.before = NULL, row.after = NULL,
col = NULL, col.before = NULL, col.after = NULL,
width = NULL, height = NULL,
force.width = FALSE, force.height = FALSE, border = NULL,
dynamic = FALSE)
packGrob(frame, grob, side = NULL,
row = NULL, row.before = NULL, row.after = NULL,
col = NULL, col.before = NULL, col.after = NULL,
width = NULL, height = NULL,
force.width = FALSE, force.height = FALSE, border = NULL,
dynamic = FALSE)
</pre>
<h3>Arguments</h3>
<table summary="R argblock">
<tr valign="top"><td><code>gPath</code></td>
<td>
A gPath object, which specifies a frame on the
display list.</td></tr>
<tr valign="top"><td><code>frame</code></td>
<td>
An object of class <code>frame</code>, typically the output
from a call to <code>grid.frame</code>. </td></tr>
<tr valign="top"><td><code>grob</code></td>
<td>
An object of class <code>grob</code>. The object to be
packed. </td></tr>
<tr valign="top"><td><code>redraw</code></td>
<td>
A boolean indicating whether the output should be updated. </td></tr>
<tr valign="top"><td><code>side</code></td>
<td>
One of <code>"left"</code>, <code>"top"</code>, <code>"right"</code>,
<code>"bottom"</code> to indicate which side to pack the object on. </td></tr>
<tr valign="top"><td><code>row</code></td>
<td>
Which row to add the object to. Must be between 1 and
the-number-of-rows-currently-in-the-frame + 1, or <code>NULL</code> in
which case the object occupies all rows. </td></tr>
<tr valign="top"><td><code>row.before</code></td>
<td>
Add the object to a new row just before this row. </td></tr>
<tr valign="top"><td><code>row.after</code></td>
<td>
Add the object to a new row just after this row. </td></tr>
<tr valign="top"><td><code>col</code></td>
<td>
Which col to add the object to. Must be between 1 and
the-number-of-cols-currently-in-the-frame + 1, or <code>NULL</code> in
which case the object occupies all cols. </td></tr>
<tr valign="top"><td><code>col.before</code></td>
<td>
Add the object to a new col just before this col.</td></tr>
<tr valign="top"><td><code>col.after</code></td>
<td>
Add the object to a new col just after this col. </td></tr>
<tr valign="top"><td><code>width</code></td>
<td>
Specifies the width of the column that the object is
added to (rather than allowing the width to be taken from the object). </td></tr>
<tr valign="top"><td><code>height</code></td>
<td>
Specifies the height of the row that the object is
added to (rather than allowing the height to be taken from the
object). </td></tr>
<tr valign="top"><td><code>force.width</code></td>
<td>
A logical value indicating whether the width of
the column that the grob is being packed into should be EITHER the
width specified in the call to <code>grid.pack</code> OR the maximum of
that width and the pre-existing width. </td></tr>
<tr valign="top"><td><code>force.height</code></td>
<td>
A logical value indicating whether the height of
the column that the grob is being packed into should be EITHER the
height specified in the call to <code>grid.pack</code> OR the maximum of
that height and the pre-existing height. </td></tr>
<tr valign="top"><td><code>border</code></td>
<td>
A <code>unit</code> object of length 4 indicating the borders
around the object. </td></tr>
<tr valign="top"><td><code>dynamic</code></td>
<td>
If the width/height is taken from the grob being
packed, this boolean flag indicates whether the grobwidth/height
unit refers directly to the grob, or uses a gPath to the grob.
In the latter case, changes to the grob will trigger a
recalculation of the width/height.</td></tr>
</table>
<h3>Details</h3>
<p>
<code>packGrob</code> modifies the given frame grob and returns the modified
frame grob.
</p>
<p>
<code>grid.pack</code> destructively modifies a frame grob on the display
list (and redraws the display list if <code>redraw</code> is <code>TRUE</code>).
</p>
<p>
These are (meant to be) very flexible functions. There are many
different
ways to specify where the new object is to be added relative to the
objects already in the frame. The function checks that the
specification is not self-contradictory.
</p>
<p>
NOTE that the width/height of the row/col that the object is added to
is taken from the object itself unless the <code>width</code>/<code>height</code>
is specified.
</p>
<h3>Value</h3>
<p>
<code>packGrob</code> returns a frame grob, but <code>grid.pack</code> returns
<code>NULL</code>.</p>
<h3>Author(s)</h3>
<p>
Paul Murrell
</p>
<h3>See Also</h3>
<p>
<code><a href="grid.frame.html">grid.frame</a></code>,
<code><a href="grid.place.html">grid.place</a></code>,
<code><a href="grid.edit.html">grid.edit</a></code>, and <code><a href="gPath.html">gPath</a></code>.
</p>
<hr><div align="center">[Package <em>grid</em> version 2.5.1 <a href="00Index.html">Index]</a></div>
</body></html>