| 1 | .\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13 |
| 2 | .\" |
| 3 | .\" Standard preamble: |
| 4 | .\" ======================================================================== |
| 5 | .de Sh \" Subsection heading |
| 6 | .br |
| 7 | .if t .Sp |
| 8 | .ne 5 |
| 9 | .PP |
| 10 | \fB\\$1\fR |
| 11 | .PP |
| 12 | .. |
| 13 | .de Sp \" Vertical space (when we can't use .PP) |
| 14 | .if t .sp .5v |
| 15 | .if n .sp |
| 16 | .. |
| 17 | .de Vb \" Begin verbatim text |
| 18 | .ft CW |
| 19 | .nf |
| 20 | .ne \\$1 |
| 21 | .. |
| 22 | .de Ve \" End verbatim text |
| 23 | .ft R |
| 24 | .fi |
| 25 | .. |
| 26 | .\" Set up some character translations and predefined strings. \*(-- will |
| 27 | .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left |
| 28 | .\" double quote, and \*(R" will give a right double quote. | will give a |
| 29 | .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to |
| 30 | .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' |
| 31 | .\" expand to `' in nroff, nothing in troff, for use with C<>. |
| 32 | .tr \(*W-|\(bv\*(Tr |
| 33 | .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' |
| 34 | .ie n \{\ |
| 35 | . ds -- \(*W- |
| 36 | . ds PI pi |
| 37 | . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch |
| 38 | . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch |
| 39 | . ds L" "" |
| 40 | . ds R" "" |
| 41 | . ds C` "" |
| 42 | . ds C' "" |
| 43 | 'br\} |
| 44 | .el\{\ |
| 45 | . ds -- \|\(em\| |
| 46 | . ds PI \(*p |
| 47 | . ds L" `` |
| 48 | . ds R" '' |
| 49 | 'br\} |
| 50 | .\" |
| 51 | .\" If the F register is turned on, we'll generate index entries on stderr for |
| 52 | .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index |
| 53 | .\" entries marked with X<> in POD. Of course, you'll have to process the |
| 54 | .\" output yourself in some meaningful fashion. |
| 55 | .if \nF \{\ |
| 56 | . de IX |
| 57 | . tm Index:\\$1\t\\n%\t"\\$2" |
| 58 | .. |
| 59 | . nr % 0 |
| 60 | . rr F |
| 61 | .\} |
| 62 | .\" |
| 63 | .\" For nroff, turn off justification. Always turn off hyphenation; it makes |
| 64 | .\" way too many mistakes in technical documents. |
| 65 | .hy 0 |
| 66 | .if n .na |
| 67 | .\" |
| 68 | .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). |
| 69 | .\" Fear. Run. Save yourself. No user-serviceable parts. |
| 70 | . \" fudge factors for nroff and troff |
| 71 | .if n \{\ |
| 72 | . ds #H 0 |
| 73 | . ds #V .8m |
| 74 | . ds #F .3m |
| 75 | . ds #[ \f1 |
| 76 | . ds #] \fP |
| 77 | .\} |
| 78 | .if t \{\ |
| 79 | . ds #H ((1u-(\\\\n(.fu%2u))*.13m) |
| 80 | . ds #V .6m |
| 81 | . ds #F 0 |
| 82 | . ds #[ \& |
| 83 | . ds #] \& |
| 84 | .\} |
| 85 | . \" simple accents for nroff and troff |
| 86 | .if n \{\ |
| 87 | . ds ' \& |
| 88 | . ds ` \& |
| 89 | . ds ^ \& |
| 90 | . ds , \& |
| 91 | . ds ~ ~ |
| 92 | . ds / |
| 93 | .\} |
| 94 | .if t \{\ |
| 95 | . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" |
| 96 | . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' |
| 97 | . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' |
| 98 | . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' |
| 99 | . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' |
| 100 | . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' |
| 101 | .\} |
| 102 | . \" troff and (daisy-wheel) nroff accents |
| 103 | .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' |
| 104 | .ds 8 \h'\*(#H'\(*b\h'-\*(#H' |
| 105 | .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] |
| 106 | .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' |
| 107 | .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' |
| 108 | .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] |
| 109 | .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] |
| 110 | .ds ae a\h'-(\w'a'u*4/10)'e |
| 111 | .ds Ae A\h'-(\w'A'u*4/10)'E |
| 112 | . \" corrections for vroff |
| 113 | .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' |
| 114 | .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' |
| 115 | . \" for low resolution devices (crt and lpr) |
| 116 | .if \n(.H>23 .if \n(.V>19 \ |
| 117 | \{\ |
| 118 | . ds : e |
| 119 | . ds 8 ss |
| 120 | . ds o a |
| 121 | . ds d- d\h'-1'\(ga |
| 122 | . ds D- D\h'-1'\(hy |
| 123 | . ds th \o'bp' |
| 124 | . ds Th \o'LP' |
| 125 | . ds ae ae |
| 126 | . ds Ae AE |
| 127 | .\} |
| 128 | .rm #[ #] #H #V #F C |
| 129 | .\" ======================================================================== |
| 130 | .\" |
| 131 | .IX Title "PLACE 1" |
| 132 | .TH PLACE 1 "2000-12-30" "perl v5.8.0" "User Contributed Perl Documentation" |
| 133 | .SH "NAME" |
| 134 | Tk::place \- Geometry manager for fixed or rubber\-sheet placement |
| 135 | .SH "SYNOPSIS" |
| 136 | .IX Header "SYNOPSIS" |
| 137 | \&\ \fI$widget\fR\->\fBplace\fR?(\fI\-option\fR=>\fIvalue\fR?, \fI\-option\fR=>\fIvalue\fR, ...)? |
| 138 | .PP |
| 139 | \&\ \fI$widget\fR\->\fBplaceForget\fR |
| 140 | .PP |
| 141 | \&\ \fI$widget\fR\->\fBplaceInfo\fR |
| 142 | .PP |
| 143 | \&\ \fI$master\fR\->\fBplaceSlaves\fR |
| 144 | .SH "DESCRIPTION" |
| 145 | .IX Header "DESCRIPTION" |
| 146 | The placer is a geometry manager for Tk. |
| 147 | It provides simple fixed placement of windows, where you specify |
| 148 | the exact size and location of one window, called the \fIslave\fR, |
| 149 | within another window, called the \fI$master\fR. |
| 150 | The placer also provides rubber-sheet placement, where you specify the |
| 151 | size and location of the slave in terms of the dimensions of |
| 152 | the master, so that the slave changes size and location |
| 153 | in response to changes in the size of the master. |
| 154 | Lastly, the placer allows you to mix these styles of placement so |
| 155 | that, for example, the slave has a fixed width and height but is |
| 156 | centered inside the master. |
| 157 | .IP "\fI$slave\fR\->\fBplace\fR?(\fI\-option\fR=>\fIvalue\fR?, \fI\-option\fR=>\fIvalue\fR, ...?)?" 4 |
| 158 | .IX Item "$slave->place?(-option=>value?, -option=>value, ...?)?" |
| 159 | The \fBplace\fR method arranges for the placer |
| 160 | to manage the geometry of \fI$slave\fR. |
| 161 | The remaining arguments consist of one or more \fI\-option\fR=>\fIvalue\fR |
| 162 | pairs that specify the way in which \fI$slave\fR's |
| 163 | geometry is managed. |
| 164 | If the placer is already managing \fI$slave\fR, then the |
| 165 | \&\fI\-option\fR=>\fIvalue\fR pairs modify the configuration for \fI$slave\fR. |
| 166 | The \fBplace\fR method returns an empty string as result. |
| 167 | The following \fI\-option\fR=>\fIvalue\fR pairs are supported: |
| 168 | .RS 4 |
| 169 | .IP "\fB\-in\fR => \fI$master\fR" 8 |
| 170 | .IX Item "-in => $master" |
| 171 | \&\fI$master\fR is the reference to the window relative |
| 172 | to which \fI$slave\fR is to be placed. |
| 173 | \&\fI$master\fR must either be \fI$slave\fR's parent or a descendant |
| 174 | of \fI$slave\fR's parent. |
| 175 | In addition, \fI$master\fR and \fI$slave\fR must both be descendants |
| 176 | of the same top-level window. |
| 177 | These restrictions are necessary to guarantee |
| 178 | that \fI$slave\fR is visible whenever \fI$master\fR is visible. |
| 179 | If this option isn't specified then the master defaults to |
| 180 | \&\fI$slave\fR's parent. |
| 181 | .IP "\fB\-x\fR => \fIlocation\fR" 8 |
| 182 | .IX Item "-x => location" |
| 183 | \&\fILocation\fR specifies the x\-coordinate within the master window |
| 184 | of the anchor point for \fI$slave\fR widget. |
| 185 | The location is specified in screen units (i.e. any of the forms |
| 186 | accepted by \fBTk_GetPixels\fR) and need not lie within the bounds |
| 187 | of the master window. |
| 188 | .IP "\fB\-relx\fR => \fIlocation\fR" 8 |
| 189 | .IX Item "-relx => location" |
| 190 | \&\fILocation\fR specifies the x\-coordinate within the master window |
| 191 | of the anchor point for \fI$slave\fR widget. |
| 192 | In this case the location is specified in a relative fashion |
| 193 | as a floating-point number: 0.0 corresponds to the left edge |
| 194 | of the master and 1.0 corresponds to the right edge of the master. |
| 195 | \&\fILocation\fR need not be in the range 0.0\-1.0. |
| 196 | If both \fB\-x\fR and \fB\-relx\fR are specified for a slave |
| 197 | then their values are summed. For example, "\fB\-relx\fR=>0.5, \fB\-x\fR=\-2" |
| 198 | positions the left edge of the slave 2 pixels to the left of the |
| 199 | center of its master. |
| 200 | .IP "\fB\-y\fR => \fIlocation\fR" 8 |
| 201 | .IX Item "-y => location" |
| 202 | \&\fILocation\fR specifies the y\-coordinate within the master window |
| 203 | of the anchor point for \fI$slave\fR widget. |
| 204 | The location is specified in screen units (i.e. any of the forms |
| 205 | accepted by \fBTk_GetPixels\fR) and need not lie within the bounds |
| 206 | of the master window. |
| 207 | .IP "\fB\-rely\fR => \fIlocation\fR" 8 |
| 208 | .IX Item "-rely => location" |
| 209 | \&\fILocation\fR specifies the y\-coordinate within the master window |
| 210 | of the anchor point for \fI$slave\fR widget. |
| 211 | In this case the value is specified in a relative fashion |
| 212 | as a floating-point number: 0.0 corresponds to the top edge |
| 213 | of the master and 1.0 corresponds to the bottom edge of the master. |
| 214 | \&\fILocation\fR need not be in the range 0.0\-1.0. |
| 215 | If both \fB\-y\fR and \fB\-rely\fR are specified for a slave |
| 216 | then their values are summed. For example, \fB\-rely\fR=>0.5, \fB\-x\fR=>3 |
| 217 | positions the top edge of the slave 3 pixels below the |
| 218 | center of its master. |
| 219 | .IP "\fB\-anchor\fR => \fIwhere\fR" 8 |
| 220 | .IX Item "-anchor => where" |
| 221 | \&\fIWhere\fR specifies which point of \fI$slave\fR is to be positioned |
| 222 | at the (x,y) location selected by the \fB\-x\fR, \fB\-y\fR, |
| 223 | \&\fB\-relx\fR, and \fB\-rely\fR options. |
| 224 | The anchor point is in terms of the outer area of \fI$slave\fR |
| 225 | including its border, if any. |
| 226 | Thus if \fIwhere\fR is \fBse\fR then the lower-right corner of |
| 227 | \&\fI$slave\fR's border will appear at the given (x,y) location |
| 228 | in the master. |
| 229 | The anchor position defaults to \fBnw\fR. |
| 230 | .IP "\fB\-width\fR => \fIsize\fR" 8 |
| 231 | .IX Item "-width => size" |
| 232 | \&\fISize\fR specifies the width for \fI$slave\fR in screen units |
| 233 | (i.e. any of the forms accepted by \fBTk_GetPixels\fR). |
| 234 | The width will be the outer width of \fI$slave\fR including its |
| 235 | border, if any. |
| 236 | If \fIsize\fR is an empty string, or if no \fB\-width\fR |
| 237 | or \fB\-relwidth\fR option is specified, then the width requested |
| 238 | internally by the window will be used. |
| 239 | .IP "\fB\-relwidth\fR => \fIsize\fR" 8 |
| 240 | .IX Item "-relwidth => size" |
| 241 | \&\fISize\fR specifies the width for \fI$slave\fR. |
| 242 | In this case the width is specified as a floating-point number |
| 243 | relative to the width of the master: 0.5 means \fI$slave\fR will |
| 244 | be half as wide as the master, 1.0 means \fI$slave\fR will have |
| 245 | the same width as the master, and so on. |
| 246 | If both \fB\-width\fR and \fB\-relwidth\fR are specified for a slave, |
| 247 | their values are summed. For example, \fB\-relwidth\fR=>1.0, \fB\-width\fR=>5 |
| 248 | makes the slave 5 pixels wider than the master. |
| 249 | .IP "\fB\-height\fR => \fIsize\fR" 8 |
| 250 | .IX Item "-height => size" |
| 251 | \&\fISize\fR specifies the height for \fI$slave\fR in screen units |
| 252 | (i.e. any of the forms accepted by \fBTk_GetPixels\fR). |
| 253 | The height will be the outer dimension of \fI$slave\fR including its |
| 254 | border, if any. |
| 255 | If \fIsize\fR is an empty string, or if no \fB\-height\fR or |
| 256 | \&\fB\-relheight\fR option is specified, then the height requested |
| 257 | internally by the window will be used. |
| 258 | .IP "\fB\-relheight\fR => \fIsize\fR" 8 |
| 259 | .IX Item "-relheight => size" |
| 260 | \&\fISize\fR specifies the height for \fI$slave\fR. |
| 261 | In this case the height is specified as a floating-point number |
| 262 | relative to the height of the master: 0.5 means \fI$slave\fR will |
| 263 | be half as high as the master, 1.0 means \fI$slave\fR will have |
| 264 | the same height as the master, and so on. |
| 265 | If both \fB\-height\fR and \fB\-relheight\fR are specified for a slave, |
| 266 | their values are summed. For example, \fB\-relheight\fR=>1.0, \fB\-height\fR=>\-2 |
| 267 | makes the slave 2 pixels shorter than the master. |
| 268 | .IP "\fB\-bordermode\fR => \fImode\fR" 8 |
| 269 | .IX Item "-bordermode => mode" |
| 270 | \&\fIMode\fR determines the degree to which borders within the |
| 271 | master are used in determining the placement of the slave. |
| 272 | The default and most common value is \fBinside\fR. |
| 273 | In this case the placer considers the area of the master to |
| 274 | be the innermost area of the master, inside any border: |
| 275 | an option of \fB\-x\fR=>\fB0\fR corresponds to an x\-coordinate just |
| 276 | inside the border and an option of \fB\-relwidth\fR=>1.0 |
| 277 | means \fI$slave\fR will fill the area inside the master's |
| 278 | border. |
| 279 | If \fImode\fR is \fBoutside\fR then the placer considers |
| 280 | the area of the master to include its border; |
| 281 | this mode is typically used when placing \fI$slave\fR |
| 282 | outside its master, as with the options |
| 283 | \&\fB\-x\fR=>\fB0\fR, \fB\-y\fR=>\fB0\fR, \fB\-anchor\fR=>\fBne\fR. |
| 284 | Lastly, \fImode\fR may be specified as \fBignore\fR, in which |
| 285 | case borders are ignored: the area of the master is considered |
| 286 | to be its official X area, which includes any internal border but |
| 287 | no external border. A bordermode of \fBignore\fR is probably |
| 288 | not very useful. |
| 289 | .Sp |
| 290 | If the same value is specified separately with |
| 291 | two different options, such as \fB\-x\fR and \fB\-relx\fR, then |
| 292 | the most recent option is used and the older one is ignored. |
| 293 | .RE |
| 294 | .RS 4 |
| 295 | .RE |
| 296 | .IP "\fI$slave\fR\->\fBplaceSlaves\fR" 4 |
| 297 | .IX Item "$slave->placeSlaves" |
| 298 | The \fBplaceSlaves\fR method returns a list of all the slave |
| 299 | windows for which \fI$master\fR is the master. |
| 300 | If there are no slaves for \fI$master\fR then an empty list is |
| 301 | returned. |
| 302 | .IP "\fI$slave\fR\->\fBplaceForget\fR" 4 |
| 303 | .IX Item "$slave->placeForget" |
| 304 | The \fBplaceForget\fR method causes the placer to stop managing |
| 305 | the geometry of \fI$slave\fR. As a side effect of this method call |
| 306 | \&\fI$slave\fR will be unmapped so that it doesn't appear on the |
| 307 | screen. |
| 308 | If \fI$slave\fR isn't currently managed by the placer then the |
| 309 | method call has no effect. |
| 310 | \&\fBplaceForget\fR returns an empty string as result. |
| 311 | .IP "\fI$slave\fR\->\fBplaceInfo\fR" 4 |
| 312 | .IX Item "$slave->placeInfo" |
| 313 | The \fBplaceInfo\fR method returns a list giving the current |
| 314 | configuration of \fI$slave\fR. |
| 315 | The list consists of \fI\-option\fR=>\fIvalue\fR pairs in exactly the |
| 316 | same form as might be specified to the \fBplace\fR |
| 317 | method. |
| 318 | If the configuration of a window has been retrieved with |
| 319 | \&\fBplaceInfo\fR, that configuration can be restored later by |
| 320 | first using \fBplaceForget\fR to erase any existing information |
| 321 | for the window and then invoking \fBplace\fR with |
| 322 | the saved information. |
| 323 | .SH "FINE POINTS" |
| 324 | .IX Header "FINE POINTS" |
| 325 | It is not necessary for the master window to be the parent |
| 326 | of the slave window. |
| 327 | This feature is useful in at least two situations. |
| 328 | First, for complex window layouts it means you can create a |
| 329 | hierarchy of subwindows whose only purpose |
| 330 | is to assist in the layout of the parent. |
| 331 | The ``\fIreal children\fR'' of the parent (i.e. the windows that |
| 332 | are significant for the application's user interface) can be |
| 333 | children of the parent yet be placed inside the windows |
| 334 | of the geometry-management hierarchy. |
| 335 | This means that the path names of the ``\fIreal children\fR'' |
| 336 | don't reflect the geometry-management hierarchy and users |
| 337 | can specify options for the real children |
| 338 | without being aware of the structure of the geometry-management |
| 339 | hierarchy. |
| 340 | .PP |
| 341 | A second reason for having a master different than the slave's |
| 342 | parent is to tie two siblings together. |
| 343 | For example, the placer can be used to force a window always to |
| 344 | be positioned centered just below one of its |
| 345 | siblings by specifying the configuration |
| 346 | .PP |
| 347 | \&\ \fB\-in\fR=>\fI$sibling\fR, \fB\-relx\fR=>0.5, \fB\-rely\fR=>1.0, |
| 348 | \&\fB\-anchor\fR=>'n', \fB\-bordermode\fR=>'outside' |
| 349 | .PP |
| 350 | Whenever the \fI$sibling\fR widget is repositioned in the future, the slave |
| 351 | will be repositioned as well. |
| 352 | .PP |
| 353 | Unlike many other geometry managers (such as the packer) |
| 354 | the placer does not make any attempt to manipulate the geometry of |
| 355 | the master windows or the parents of slave windows (i.e. it doesn't |
| 356 | set their requested sizes). |
| 357 | To control the sizes of these windows, make them windows like |
| 358 | frames and canvases that provide configuration options for this purpose. |
| 359 | .SH "SEE ALSO" |
| 360 | .IX Header "SEE ALSO" |
| 361 | Tk::form |
| 362 | Tk::grid |
| 363 | Tk::pack |
| 364 | .SH "KEYWORDS" |
| 365 | .IX Header "KEYWORDS" |
| 366 | geometry manager, height, location, master, place, rubber sheet, slave, width |