Commit | Line | Data |
---|---|---|
920dae64 AT |
1 | '\" |
2 | '\" Copyright (c) 1992 The Regents of the University of California. | |
3 | '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. | |
4 | '\" | |
5 | '\" See the file "license.terms" for information on usage and redistribution | |
6 | '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. | |
7 | '\" | |
8 | '\" RCS: @(#) $Id: place.n,v 1.3.8.1 2004/10/28 12:25:22 dkf Exp $ | |
9 | '\" | |
10 | '\" The definitions below are for supplemental macros used in Tcl/Tk | |
11 | '\" manual entries. | |
12 | '\" | |
13 | '\" .AP type name in/out ?indent? | |
14 | '\" Start paragraph describing an argument to a library procedure. | |
15 | '\" type is type of argument (int, etc.), in/out is either "in", "out", | |
16 | '\" or "in/out" to describe whether procedure reads or modifies arg, | |
17 | '\" and indent is equivalent to second arg of .IP (shouldn't ever be | |
18 | '\" needed; use .AS below instead) | |
19 | '\" | |
20 | '\" .AS ?type? ?name? | |
21 | '\" Give maximum sizes of arguments for setting tab stops. Type and | |
22 | '\" name are examples of largest possible arguments that will be passed | |
23 | '\" to .AP later. If args are omitted, default tab stops are used. | |
24 | '\" | |
25 | '\" .BS | |
26 | '\" Start box enclosure. From here until next .BE, everything will be | |
27 | '\" enclosed in one large box. | |
28 | '\" | |
29 | '\" .BE | |
30 | '\" End of box enclosure. | |
31 | '\" | |
32 | '\" .CS | |
33 | '\" Begin code excerpt. | |
34 | '\" | |
35 | '\" .CE | |
36 | '\" End code excerpt. | |
37 | '\" | |
38 | '\" .VS ?version? ?br? | |
39 | '\" Begin vertical sidebar, for use in marking newly-changed parts | |
40 | '\" of man pages. The first argument is ignored and used for recording | |
41 | '\" the version when the .VS was added, so that the sidebars can be | |
42 | '\" found and removed when they reach a certain age. If another argument | |
43 | '\" is present, then a line break is forced before starting the sidebar. | |
44 | '\" | |
45 | '\" .VE | |
46 | '\" End of vertical sidebar. | |
47 | '\" | |
48 | '\" .DS | |
49 | '\" Begin an indented unfilled display. | |
50 | '\" | |
51 | '\" .DE | |
52 | '\" End of indented unfilled display. | |
53 | '\" | |
54 | '\" .SO | |
55 | '\" Start of list of standard options for a Tk widget. The | |
56 | '\" options follow on successive lines, in four columns separated | |
57 | '\" by tabs. | |
58 | '\" | |
59 | '\" .SE | |
60 | '\" End of list of standard options for a Tk widget. | |
61 | '\" | |
62 | '\" .OP cmdName dbName dbClass | |
63 | '\" Start of description of a specific option. cmdName gives the | |
64 | '\" option's name as specified in the class command, dbName gives | |
65 | '\" the option's name in the option database, and dbClass gives | |
66 | '\" the option's class in the option database. | |
67 | '\" | |
68 | '\" .UL arg1 arg2 | |
69 | '\" Print arg1 underlined, then print arg2 normally. | |
70 | '\" | |
71 | '\" RCS: @(#) $Id: man.macros,v 1.4 2000/08/25 06:18:32 ericm Exp $ | |
72 | '\" | |
73 | '\" # Set up traps and other miscellaneous stuff for Tcl/Tk man pages. | |
74 | .if t .wh -1.3i ^B | |
75 | .nr ^l \n(.l | |
76 | .ad b | |
77 | '\" # Start an argument description | |
78 | .de AP | |
79 | .ie !"\\$4"" .TP \\$4 | |
80 | .el \{\ | |
81 | . ie !"\\$2"" .TP \\n()Cu | |
82 | . el .TP 15 | |
83 | .\} | |
84 | .ta \\n()Au \\n()Bu | |
85 | .ie !"\\$3"" \{\ | |
86 | \&\\$1 \\fI\\$2\\fP (\\$3) | |
87 | .\".b | |
88 | .\} | |
89 | .el \{\ | |
90 | .br | |
91 | .ie !"\\$2"" \{\ | |
92 | \&\\$1 \\fI\\$2\\fP | |
93 | .\} | |
94 | .el \{\ | |
95 | \&\\fI\\$1\\fP | |
96 | .\} | |
97 | .\} | |
98 | .. | |
99 | '\" # define tabbing values for .AP | |
100 | .de AS | |
101 | .nr )A 10n | |
102 | .if !"\\$1"" .nr )A \\w'\\$1'u+3n | |
103 | .nr )B \\n()Au+15n | |
104 | .\" | |
105 | .if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n | |
106 | .nr )C \\n()Bu+\\w'(in/out)'u+2n | |
107 | .. | |
108 | .AS Tcl_Interp Tcl_CreateInterp in/out | |
109 | '\" # BS - start boxed text | |
110 | '\" # ^y = starting y location | |
111 | '\" # ^b = 1 | |
112 | .de BS | |
113 | .br | |
114 | .mk ^y | |
115 | .nr ^b 1u | |
116 | .if n .nf | |
117 | .if n .ti 0 | |
118 | .if n \l'\\n(.lu\(ul' | |
119 | .if n .fi | |
120 | .. | |
121 | '\" # BE - end boxed text (draw box now) | |
122 | .de BE | |
123 | .nf | |
124 | .ti 0 | |
125 | .mk ^t | |
126 | .ie n \l'\\n(^lu\(ul' | |
127 | .el \{\ | |
128 | .\" Draw four-sided box normally, but don't draw top of | |
129 | .\" box if the box started on an earlier page. | |
130 | .ie !\\n(^b-1 \{\ | |
131 | \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul' | |
132 | .\} | |
133 | .el \}\ | |
134 | \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul' | |
135 | .\} | |
136 | .\} | |
137 | .fi | |
138 | .br | |
139 | .nr ^b 0 | |
140 | .. | |
141 | '\" # VS - start vertical sidebar | |
142 | '\" # ^Y = starting y location | |
143 | '\" # ^v = 1 (for troff; for nroff this doesn't matter) | |
144 | .de VS | |
145 | .if !"\\$2"" .br | |
146 | .mk ^Y | |
147 | .ie n 'mc \s12\(br\s0 | |
148 | .el .nr ^v 1u | |
149 | .. | |
150 | '\" # VE - end of vertical sidebar | |
151 | .de VE | |
152 | .ie n 'mc | |
153 | .el \{\ | |
154 | .ev 2 | |
155 | .nf | |
156 | .ti 0 | |
157 | .mk ^t | |
158 | \h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n' | |
159 | .sp -1 | |
160 | .fi | |
161 | .ev | |
162 | .\} | |
163 | .nr ^v 0 | |
164 | .. | |
165 | '\" # Special macro to handle page bottom: finish off current | |
166 | '\" # box/sidebar if in box/sidebar mode, then invoked standard | |
167 | '\" # page bottom macro. | |
168 | .de ^B | |
169 | .ev 2 | |
170 | 'ti 0 | |
171 | 'nf | |
172 | .mk ^t | |
173 | .if \\n(^b \{\ | |
174 | .\" Draw three-sided box if this is the box's first page, | |
175 | .\" draw two sides but no top otherwise. | |
176 | .ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c | |
177 | .el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c | |
178 | .\} | |
179 | .if \\n(^v \{\ | |
180 | .nr ^x \\n(^tu+1v-\\n(^Yu | |
181 | \kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c | |
182 | .\} | |
183 | .bp | |
184 | 'fi | |
185 | .ev | |
186 | .if \\n(^b \{\ | |
187 | .mk ^y | |
188 | .nr ^b 2 | |
189 | .\} | |
190 | .if \\n(^v \{\ | |
191 | .mk ^Y | |
192 | .\} | |
193 | .. | |
194 | '\" # DS - begin display | |
195 | .de DS | |
196 | .RS | |
197 | .nf | |
198 | .sp | |
199 | .. | |
200 | '\" # DE - end display | |
201 | .de DE | |
202 | .fi | |
203 | .RE | |
204 | .sp | |
205 | .. | |
206 | '\" # SO - start of list of standard options | |
207 | .de SO | |
208 | .SH "STANDARD OPTIONS" | |
209 | .LP | |
210 | .nf | |
211 | .ta 5.5c 11c | |
212 | .ft B | |
213 | .. | |
214 | '\" # SE - end of list of standard options | |
215 | .de SE | |
216 | .fi | |
217 | .ft R | |
218 | .LP | |
219 | See the \\fBoptions\\fR manual entry for details on the standard options. | |
220 | .. | |
221 | '\" # OP - start of full description for a single option | |
222 | .de OP | |
223 | .LP | |
224 | .nf | |
225 | .ta 4c | |
226 | Command-Line Name: \\fB\\$1\\fR | |
227 | Database Name: \\fB\\$2\\fR | |
228 | Database Class: \\fB\\$3\\fR | |
229 | .fi | |
230 | .IP | |
231 | .. | |
232 | '\" # CS - begin code excerpt | |
233 | .de CS | |
234 | .RS | |
235 | .nf | |
236 | .ta .25i .5i .75i 1i | |
237 | .. | |
238 | '\" # CE - end code excerpt | |
239 | .de CE | |
240 | .fi | |
241 | .RE | |
242 | .. | |
243 | .de UL | |
244 | \\$1\l'|0\(ul'\\$2 | |
245 | .. | |
246 | .TH place n "" Tk "Tk Built-In Commands" | |
247 | .BS | |
248 | '\" Note: do not modify the .SH NAME line immediately below! | |
249 | .SH NAME | |
250 | place \- Geometry manager for fixed or rubber-sheet placement | |
251 | .SH SYNOPSIS | |
252 | \fBplace \fIoption arg \fR?\fIarg ...\fR? | |
253 | .BE | |
254 | ||
255 | .SH DESCRIPTION | |
256 | .PP | |
257 | The placer is a geometry manager for Tk. | |
258 | It provides simple fixed placement of windows, where you specify | |
259 | the exact size and location of one window, called the \fIslave\fR, | |
260 | within another window, called the \fImaster\fR. | |
261 | The placer also provides rubber-sheet placement, where you specify the | |
262 | size and location of the slave in terms of the dimensions of | |
263 | the master, so that the slave changes size and location | |
264 | in response to changes in the size of the master. | |
265 | Lastly, the placer allows you to mix these styles of placement so | |
266 | that, for example, the slave has a fixed width and height but is | |
267 | centered inside the master. | |
268 | .PP | |
269 | .TP | |
270 | \fBplace \fIwindow option value \fR?\fIoption value ...\fR? | |
271 | Arrange for the placer to manage the geometry of a slave whose | |
272 | pathName is \fIwindow\fR. The remaining arguments consist of one or | |
273 | more \fIoption\-value\fR pairs that specify the way in which | |
274 | \fIwindow\fR's geometry is managed. \fIOption\fR may have any of the | |
275 | values accepted by the \fBplace configure\fR command. | |
276 | .TP | |
277 | \fBplace configure \fIwindow \fR?\fIoption\fR? ?\fIvalue option value ...\fR? | |
278 | Query or modify the geometry options of the slave given by | |
279 | \fIwindow\fR. If no \fIoption\fR is specified, this command returns a | |
280 | list describing the available options (see \fBTk_ConfigureInfo\fR for | |
281 | information on the format of this list). If \fIoption\fR is specified | |
282 | with no \fIvalue\fR, then the command returns a list describing the | |
283 | one named option (this list will be identical to the corresponding | |
284 | sublist of the value returned if no \fIoption\fR is specified). If | |
285 | one or more \fIoption\-value\fR pairs are specified, then the command | |
286 | modifies the given option(s) to have the given value(s); in this case | |
287 | the command returns an empty string. | |
288 | ||
289 | The following \fIoption\-value\fR pairs are supported: | |
290 | .RS | |
291 | .TP | |
292 | \fB\-anchor \fIwhere\fR | |
293 | \fIWhere\fR specifies which point of \fIwindow\fR is to be positioned | |
294 | at the (x,y) location selected by the \fB\-x\fR, \fB\-y\fR, | |
295 | \fB\-relx\fR, and \fB\-rely\fR options. | |
296 | The anchor point is in terms of the outer area of \fIwindow\fR | |
297 | including its border, if any. | |
298 | Thus if \fIwhere\fR is \fBse\fR then the lower-right corner of | |
299 | \fIwindow\fR's border will appear at the given (x,y) location | |
300 | in the master. | |
301 | The anchor position defaults to \fBnw\fR. | |
302 | .TP | |
303 | \fB\-bordermode \fImode\fR | |
304 | \fIMode\fR determines the degree to which borders within the | |
305 | master are used in determining the placement of the slave. | |
306 | The default and most common value is \fBinside\fR. | |
307 | In this case the placer considers the area of the master to | |
308 | be the innermost area of the master, inside any border: | |
309 | an option of \fB\-x 0\fR corresponds to an x-coordinate just | |
310 | inside the border and an option of \fB\-relwidth 1.0\fR | |
311 | means \fIwindow\fR will fill the area inside the master's | |
312 | border. | |
313 | ||
314 | If \fImode\fR is \fBoutside\fR then the placer considers | |
315 | the area of the master to include its border; | |
316 | this mode is typically used when placing \fIwindow\fR | |
317 | outside its master, as with the options \fB\-x 0 \-y 0 \-anchor ne\fR. | |
318 | Lastly, \fImode\fR may be specified as \fBignore\fR, in which | |
319 | case borders are ignored: the area of the master is considered | |
320 | to be its official X area, which includes any internal border but | |
321 | no external border. A bordermode of \fBignore\fR is probably | |
322 | not very useful. | |
323 | .TP | |
324 | \fB\-height \fIsize\fR | |
325 | \fISize\fR specifies the height for \fIwindow\fR in screen units | |
326 | (i.e. any of the forms accepted by \fBTk_GetPixels\fR). | |
327 | The height will be the outer dimension of \fIwindow\fR including its | |
328 | border, if any. | |
329 | If \fIsize\fR is an empty string, or if no \fB\-height\fR or | |
330 | \fB\-relheight\fR option is specified, then the height requested | |
331 | internally by the window will be used. | |
332 | .TP | |
333 | \fB\-in \fImaster\fR | |
334 | \fIMaster\fR specifies the path name of the window relative | |
335 | to which \fIwindow\fR is to be placed. | |
336 | \fIMaster\fR must either be \fIwindow\fR's parent or a descendant | |
337 | of \fIwindow\fR's parent. | |
338 | In addition, \fImaster\fR and \fIwindow\fR must both be descendants | |
339 | of the same top-level window. | |
340 | These restrictions are necessary to guarantee | |
341 | that \fIwindow\fR is visible whenever \fImaster\fR is visible. | |
342 | If this option isn't specified then the master defaults to | |
343 | \fIwindow\fR's parent. | |
344 | .TP | |
345 | \fB\-relheight \fIsize\fR | |
346 | \fISize\fR specifies the height for \fIwindow\fR. | |
347 | In this case the height is specified as a floating-point number | |
348 | relative to the height of the master: 0.5 means \fIwindow\fR will | |
349 | be half as high as the master, 1.0 means \fIwindow\fR will have | |
350 | the same height as the master, and so on. | |
351 | If both \fB\-height\fR and \fB\-relheight\fR are specified for a slave, | |
352 | their values are summed. For example, \fB\-relheight 1.0 \-height \-2\fR | |
353 | makes the slave 2 pixels shorter than the master. | |
354 | .TP | |
355 | \fB\-relwidth \fIsize\fR | |
356 | \fISize\fR specifies the width for \fIwindow\fR. | |
357 | In this case the width is specified as a floating-point number | |
358 | relative to the width of the master: 0.5 means \fIwindow\fR will | |
359 | be half as wide as the master, 1.0 means \fIwindow\fR will have | |
360 | the same width as the master, and so on. | |
361 | If both \fB\-width\fR and \fB\-relwidth\fR are specified for a slave, | |
362 | their values are summed. For example, \fB\-relwidth 1.0 \-width 5\fR | |
363 | makes the slave 5 pixels wider than the master. | |
364 | .TP | |
365 | \fB\-relx \fIlocation\fR | |
366 | \fILocation\fR specifies the x-coordinate within the master window | |
367 | of the anchor point for \fIwindow\fR. | |
368 | In this case the location is specified in a relative fashion | |
369 | as a floating-point number: 0.0 corresponds to the left edge | |
370 | of the master and 1.0 corresponds to the right edge of the master. | |
371 | \fILocation\fR need not be in the range 0.0\-1.0. | |
372 | If both \fB\-x\fR and \fB\-relx\fR are specified for a slave | |
373 | then their values are summed. For example, \fB\-relx 0.5 \-x \-2\fR | |
374 | positions the left edge of the slave 2 pixels to the left of the | |
375 | center of its master. | |
376 | .TP | |
377 | \fB\-rely \fIlocation\fR | |
378 | \fILocation\fR specifies the y-coordinate within the master window | |
379 | of the anchor point for \fIwindow\fR. | |
380 | In this case the value is specified in a relative fashion | |
381 | as a floating-point number: 0.0 corresponds to the top edge | |
382 | of the master and 1.0 corresponds to the bottom edge of the master. | |
383 | \fILocation\fR need not be in the range 0.0\-1.0. | |
384 | If both \fB\-y\fR and \fB\-rely\fR are specified for a slave | |
385 | then their values are summed. For example, \fB\-rely 0.5 \-x 3\fR | |
386 | positions the top edge of the slave 3 pixels below the | |
387 | center of its master. | |
388 | .TP | |
389 | \fB\-width \fIsize\fR | |
390 | \fISize\fR specifies the width for \fIwindow\fR in screen units | |
391 | (i.e. any of the forms accepted by \fBTk_GetPixels\fR). | |
392 | The width will be the outer width of \fIwindow\fR including its | |
393 | border, if any. | |
394 | If \fIsize\fR is an empty string, or if no \fB\-width\fR | |
395 | or \fB\-relwidth\fR option is specified, then the width requested | |
396 | internally by the window will be used. | |
397 | .TP | |
398 | \fB\-x \fIlocation\fR | |
399 | \fILocation\fR specifies the x-coordinate within the master window | |
400 | of the anchor point for \fIwindow\fR. | |
401 | The location is specified in screen units (i.e. any of the forms | |
402 | accepted by \fBTk_GetPixels\fR) and need not lie within the bounds | |
403 | of the master window. | |
404 | .TP | |
405 | \fB\-y \fIlocation\fR | |
406 | \fILocation\fR specifies the y-coordinate within the master window | |
407 | of the anchor point for \fIwindow\fR. | |
408 | The location is specified in screen units (i.e. any of the forms | |
409 | accepted by \fBTk_GetPixels\fR) and need not lie within the bounds | |
410 | of the master window. | |
411 | .PP | |
412 | If the same value is specified separately with | |
413 | two different options, such as \fB\-x\fR and \fB\-relx\fR, then | |
414 | the most recent option is used and the older one is ignored. | |
415 | .RE | |
416 | .TP | |
417 | \fBplace forget \fIwindow\fR | |
418 | Causes the placer to stop managing the geometry of \fIwindow\fR. As a | |
419 | side effect of this command \fIwindow\fR will be unmapped so that it | |
420 | doesn't appear on the screen. If \fIwindow\fR isn't currently managed | |
421 | by the placer then the command has no effect. This command returns an | |
422 | empty string. | |
423 | .TP | |
424 | \fBplace info \fIwindow\fR | |
425 | Returns a list giving the current configuration of \fIwindow\fR. | |
426 | The list consists of \fIoption\-value\fR pairs in exactly the | |
427 | same form as might be specified to the \fBplace configure\fR | |
428 | command. | |
429 | .TP | |
430 | \fBplace slaves \fIwindow\fR | |
431 | Returns a list of all the slave windows for which \fIwindow\fR is the master. | |
432 | If there are no slaves for \fIwindow\fR then an empty string is returned. | |
433 | .PP | |
434 | If the configuration of a window has been retrieved with | |
435 | \fBplace info\fR, that configuration can be restored later by | |
436 | first using \fBplace forget\fR to erase any existing information | |
437 | for the window and then invoking \fBplace configure\fR with | |
438 | the saved information. | |
439 | .SH "FINE POINTS" | |
440 | .PP | |
441 | It is not necessary for the master window to be the parent | |
442 | of the slave window. | |
443 | This feature is useful in at least two situations. | |
444 | First, for complex window layouts it means you can create a | |
445 | hierarchy of subwindows whose only purpose | |
446 | is to assist in the layout of the parent. | |
447 | The ``real children'' of the parent (i.e. the windows that | |
448 | are significant for the application's user interface) can be | |
449 | children of the parent yet be placed inside the windows | |
450 | of the geometry-management hierarchy. | |
451 | This means that the path names of the ``real children'' | |
452 | don't reflect the geometry-management hierarchy and users | |
453 | can specify options for the real children | |
454 | without being aware of the structure of the geometry-management | |
455 | hierarchy. | |
456 | .PP | |
457 | A second reason for having a master different than the slave's | |
458 | parent is to tie two siblings together. | |
459 | For example, the placer can be used to force a window always to | |
460 | be positioned centered just below one of its | |
461 | siblings by specifying the configuration | |
462 | .CS | |
463 | \fB\-in \fIsibling\fB \-relx 0.5 \-rely 1.0 \-anchor n \-bordermode outside\fR | |
464 | .CE | |
465 | Whenever the sibling is repositioned in the future, the slave | |
466 | will be repositioned as well. | |
467 | .PP | |
468 | Unlike many other geometry managers (such as the packer) | |
469 | the placer does not make any attempt to manipulate the geometry of | |
470 | the master windows or the parents of slave windows (i.e. it doesn't | |
471 | set their requested sizes). | |
472 | To control the sizes of these windows, make them windows like | |
473 | frames and canvases that provide configuration options for this purpose. | |
474 | .SH EXAMPLE | |
475 | Make the label occupy the middle bit of the toplevel, no matter how it | |
476 | is resized: | |
477 | .CS | |
478 | label .l \-text "In the\\nMiddle!" \-bg black \-fg white | |
479 | \fBplace\fR .l \-relwidth .3 \-relx .35 \-relheight .3 \-rely .35 | |
480 | .CE | |
481 | ||
482 | .SH "SEE ALSO" | |
483 | grid(n), pack(n) | |
484 | ||
485 | .SH KEYWORDS | |
486 | geometry manager, height, location, master, place, rubber sheet, slave, width |