1pod::Prima::Widget::plaUcsee(r3)Contributed Perl Documenptoadt:i:oPnrima::Widget::place(3)
2
3
4

NAME

6       Prima::Widget::place - Geometry manager for fixed or rubber-sheet
7       placement
8

SYNOPSIS

10          $widget->place(option=>value?, option=>value, ...)
11
12          $widget->placeForget;
13
14          $widget->placeInfo(option=>value?, option=>value, ...);
15          $widget->geometry( gt::Place);
16
17          $master->placeSlaves
18

DESCRIPTION

20       The placer is a geometry manager from Tk.  It provides simple fixed
21       placement of windows, where you specify the exact size and location of
22       one window, called the slave, within another window, called the
23       $master.  The placer also provides rubber-sheet placement, where you
24       specify the size and location of the slave in terms of the dimensions
25       of the master, so that the slave changes size and location in response
26       to changes in the size of the master.  Lastly, the placer allows you to
27       mix these styles of placement so that, for example, the slave has a
28       fixed width and height but is centered inside the master.
29
30       place %OPTIONS
31           The place method arranges for the placer to manage the geometry of
32           $slave.  The remaining arguments consist of one or more
33           option=>value pairs that specify the way in which $slave's geometry
34           is managed.  If the placer is already managing $slave, then the
35           option=>value pairs modify the configuration for $slave.  The place
36           method returns an empty string as result.  The following
37           option=>value pairs are supported:
38
39           in => $master
40                   $master is the reference to the window relative to which
41                   $slave is to be placed.  $master must neither be $slave's
42                   child nor be present in a slaves list that directly or
43                   indirectly refers to the $slave.
44
45                   If this option isn't specified then the master defaults to
46                   $slave's owner.
47
48           x => location
49                   Location specifies the x-coordinate within the master
50                   window of the anchor point for $slave widget.
51
52           relx => location
53                   Location specifies the x-coordinate within the master
54                   window of the anchor point for $slave widget.  In this case
55                   the location is specified in a relative fashion as a
56                   floating-point number:  0.0 corresponds to the left edge of
57                   the master and 1.0 corresponds to the right edge of the
58                   master.  Location need not be in the range 0.0-1.0.  If
59                   both x and relx are specified for a slave then their values
60                   are summed.  For example, "relx=>0.5, x=-2" positions the
61                   left edge of the slave 2 pixels to the left of the center
62                   of its master.
63
64           y => location
65                   Location specifies the y-coordinate within the master
66                   window of the anchor point for $slave widget.
67
68           rely => location
69                   Location specifies the y-coordinate within the master
70                   window of the anchor point for $slave widget.  In this case
71                   the value is specified in a relative fashion as a floating-
72                   point number:  0.0 corresponds to the top edge of the
73                   master and 1.0 corresponds to the bottom edge of the
74                   master.  Location need not be in the range 0.0-1.0.  If
75                   both y and rely are specified for a slave then their values
76                   are summed.  For example, rely=>0.5, x=>3 positions the top
77                   edge of the slave 3 pixels below the center of its master.
78
79           anchor => where
80                   Where specifies which point of $slave is to be positioned
81                   at the (x,y) location selected by the x, y, relx, and rely
82                   options.  Thus if where is se then the lower-right corner
83                   of $slave's border will appear at the given (x,y) location
84                   in the master.  The anchor position defaults to nw.
85
86           width => size
87                   Size specifies the width for $slave.  If size is an empty
88                   string, or if no width or relwidth option is specified,
89                   then the width requested internally by the window will be
90                   used.
91
92           relwidth => size
93                   Size specifies the width for $slave.  In this case the
94                   width is specified as a floating-point number relative to
95                   the width of the master: 0.5 means $slave will be half as
96                   wide as the master, 1.0 means $slave will have the same
97                   width as the master, and so on.  If both width and relwidth
98                   are specified for a slave, their values are summed.  For
99                   example, relwidth=>1.0, width=>5 makes the slave 5 pixels
100                   wider than the master.
101
102           height => size
103                   Size specifies the height for $slave.  If size is an empty
104                   string, or if no height or relheight option is specified,
105                   then the height requested internally by the window will be
106                   used.
107
108           relheight => size
109                   Size specifies the height for $slave.  In this case the
110                   height is specified as a floating-point number relative to
111                   the height of the master: 0.5 means $slave will be half as
112                   high as the master, 1.0 means $slave will have the same
113                   height as the master, and so on.  If both height and
114                   relheight are specified for a slave, their values are
115                   summed.  For example, relheight=>1.0, height=>-2 makes the
116                   slave 2 pixels shorter than the master.
117
118       placeSlaves
119           The placeSlaves method returns a list of all the slave windows for
120           which $master is the master.  If there are no slaves for $master
121           then an empty list is returned.
122
123       placeForget
124           The placeForget method causes the placer to stop managing the
125           geometry of $slave.  If $slave isn't currently managed by the
126           placer then the method call has no effect.
127
128       placeInfo %OPTIONS
129           In get-mode the placeInfo method returns a list giving the current
130           configuration of $slave.  The list consists of option=>value pairs
131           in exactly the same form as might be specified to the place method.
132           If the configuration of a window has been retrieved with placeInfo,
133           that configuration can be restored later by first using placeInfo
134           in set-mode and setting geometry to "gt::Place", which is
135           equivalent to a direct call to place.
136

Fine points

138       It is not necessary for the master window to be the owner of the slave
139       window.  This feature is useful in at least two situations.  First, for
140       complex window layouts it means you can create a hierarchy of
141       subwindows whose only purpose is to assist in the layout of the owner.
142       The ``real children'' of the owner (i.e. the windows that are
143       significant for the application's user interface) can be children of
144       the owner yet be placed inside the windows of the geometry-management
145       hierarchy.  This means that the path names of the ``real children''
146       don't reflect the geometry-management hierarchy and users can specify
147       options for the real children without being aware of the structure of
148       the geometry-management hierarchy.
149
150       A second reason for having a master different than the slave's owner is
151       to tie two siblings together.  For example, the placer can be used to
152       force a window always to be positioned centered just below one of its
153       siblings by specifying the configuration
154
155           in=>$sibling, relx=>0.5, rely=>1.0, anchor=>'n'
156
157       Whenever the $sibling widget is repositioned in the future, the slave
158       will be repositioned as well.
159
160       Unlike the other geometry managers (such as the packer) the placer does
161       not make any attempt to manipulate the geometry of the master windows
162       or the owners of slave windows (i.e. it doesn't set their requested
163       sizes).
164

SEE ALSO

166       Prima, Prima::Widget
167
168       Tk::place Tk::pack
169
170
171
172perl v5.32.0                      2020-07-28      pod::Prima::Widget::place(3)
Impressum