GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  TK::PLACE (3)

.ds Aq ’

NAME

Tk::place - Geometry manager for fixed or rubber-sheet placement

CONTENTS

SYNOPSIS

$widget-><B>placeB>?(-option=>value?, -option=>value, ...)?

$widget-><B>placeForgetB>

$widget-><B>placeInfoB>

$master-><B>placeSlavesB>

DESCRIPTION

The placer is a geometry manager for Tk. It provides simple fixed placement of windows, where you specify the exact size and location of one window, called the slave, within another window, called the master. The placer also provides rubber-sheet placement, where you specify the size and location of the slave in terms of the dimensions of the master, so that the slave changes size and location in response to changes in the size of the master. Lastly, the placer allows you to mix these styles of placement so that, for example, the slave has a fixed width and height but is centered inside the master.
$slave-><B>placeB>?(-option=>value?, -option=>value, ...?)? The <B>placeB> method arranges for the placer to manage the geometry of $slave. The remaining arguments consist of one or more -option=>value pairs that specify the way in which $slave’s geometry is managed. -option may have any of the values accepted by the placeConfigure method.

The <B>placeB> method returns $slave.

$slave-><B>placeConfigureB>?(-option=>value?, -option=>value, ...?)? Query or modify the geometry options of the $slave. If no option is specified, this method returns a list describing the available options (see Tk_ConfigureInfo for information on the format of this list). If option is specified with no value, then the command returns a list describing the one named option (this list will be identical to the corresponding sublist of the value returned if no option is specified). If one or more option-value pairs are specified, then the method modifies the given option(s) to have the given value(s); in this case the command returns undef.

The following -option=>value pairs are supported:
<B>-anchorB> => where Where specifies which point of $slave is to be positioned at the (x,y) location selected by the <B>-xB>, <B>-yB>, <B>-relxB>, and <B>-relyB> options. The anchor point is in terms of the outer area of $slave including its border, if any. Thus if where is <B>seB> then the lower-right corner of $slave’s border will appear at the given (x,y) location in the master. The anchor position defaults to <B>nwB>.
<B>-bordermodeB> => mode Mode determines the degree to which borders within the master are used in determining the placement of the slave. The default and most common value is <B>insideB>. In this case the placer considers the area of the master to be the innermost area of the master, inside any border: an option of <B>-xB>=><B>0B> corresponds to an x-coordinate just inside the border and an option of <B>-relwidthB>=>1.0 means $slave will fill the area inside the master’s border. If mode is <B>outsideB> then the placer considers the area of the master to include its border; this mode is typically used when placing $slave outside its master, as with the options <B>-xB>=><B>0B>, <B>-yB>=><B>0B>, <B>-anchorB>=><B>neB>. Lastly, mode may be specified as <B>ignoreB>, in which case borders are ignored: the area of the master is considered to be its official X area, which includes any internal border but no external border. A bordermode of <B>ignoreB> is probably not very useful.
<B>-heightB> => size Size specifies the height for $slave in screen units (i.e. any of the forms accepted by <B>Tk_GetPixelsB>). The height will be the outer dimension of $slave including its border, if any. If size is an empty string, or if no <B>-heightB> or <B>-relheightB> option is specified, then the height requested internally by the window will be used.
<B>-inB> => $master $master is the reference to the window relative to which $slave is to be placed. $master must either be $slave’s parent or a descendant of $slave’s parent. In addition, $master and $slave must both be descendants of the same top-level window. These restrictions are necessary to guarantee that $slave is visible whenever $master is visible. If this option isn’t specified then the master defaults to $slave’s parent.
<B>-relheightB> => size Size specifies the height for $slave. In this case the height is specified as a floating-point number relative to the height of the master: 0.5 means $slave will be half as high as the master, 1.0 means $slave will have the same height as the master, and so on. If both <B>-heightB> and <B>-relheightB> are specified for a slave, their values are summed. For example, <B>-relheightB>=>1.0, <B>-heightB>=>-2 makes the slave 2 pixels shorter than the master.
<B>-relwidthB> => size Size specifies the width for $slave. In this case the width is specified as a floating-point number relative to the width of the master: 0.5 means $slave will be half as wide as the master, 1.0 means $slave will have the same width as the master, and so on. If both <B>-widthB> and <B>-relwidthB> are specified for a slave, their values are summed. For example, <B>-relwidthB>=>1.0, <B>-widthB>=>5 makes the slave 5 pixels wider than the master.
<B>-relxB> => location Location specifies the x-coordinate within the master window of the anchor point for $slave widget. In this case the location is specified in a relative fashion as a floating-point number: 0.0 corresponds to the left edge of the master and 1.0 corresponds to the right edge of the master. Location need not be in the range 0.0-1.0. If both <B>-xB> and <B>-relxB> are specified for a slave then their values are summed. For example, "<B>-relxB>=>0.5, <B>-xB>=-2" positions the left edge of the slave 2 pixels to the left of the center of its master.
<B>-relyB> => location Location specifies the y-coordinate within the master window of the anchor point for $slave widget. In this case the value is specified in a relative fashion as a floating-point number: 0.0 corresponds to the top edge of the master and 1.0 corresponds to the bottom edge of the master. Location need not be in the range 0.0-1.0. If both <B>-yB> and <B>-relyB> are specified for a slave then their values are summed. For example, <B>-relyB>=>0.5, <B>-xB>=>3 positions the top edge of the slave 3 pixels below the center of its master.
<B>-widthB> => size Size specifies the width for $slave in screen units (i.e. any of the forms accepted by <B>Tk_GetPixelsB>). The width will be the outer width of $slave including its border, if any. If size is an empty string, or if no <B>-widthB> or <B>-relwidthB> option is specified, then the width requested internally by the window will be used.
<B>-xB> => location Location specifies the x-coordinate within the master window of the anchor point for $slave widget. The location is specified in screen units (i.e. any of the forms accepted by <B>Tk_GetPixelsB>) and need not lie within the bounds of the master window.
<B>-yB> => location Location specifies the y-coordinate within the master window of the anchor point for $slave widget. The location is specified in screen units (i.e. any of the forms accepted by <B>Tk_GetPixelsB>) and need not lie within the bounds of the master window.

If the same value is specified separately with two different options, such as <B>-xB> and <B>-relxB>, then the most recent option is used and the older one is ignored.

$slave-><B>placeForgetB> The <B>placeForgetB> method causes the placer to stop managing the geometry of $slave. As a side effect of this method call $slave will be unmapped so that it doesn’t appear on the screen. If $slave isn’t currently managed by the placer then the method call has no effect. <B>placeForgetB> returns an empty string as result.
$slave-><B>placeInfoB> The <B>placeInfoB> method returns a list giving the current configuration of $slave. The list consists of -option=>value pairs in exactly the same form as might be specified to the <B>placeB> method.
$slave-><B>placeSlavesB> The <B>placeSlavesB> method returns a list of all the slave windows for which $master is the master. If there are no slaves for $master then an empty list is returned.
If the configuration of a window has been retrieved with <B>placeInfoB>, that configuration can be restored later by first using <B>placeForgetB> to erase any existing information for the window and then invoking <B>placeB> with the saved information.

FINE POINTS

It is not necessary for the master window to be the parent of the slave window. This feature is useful in at least two situations. First, for complex window layouts it means you can create a hierarchy of subwindows whose only purpose is to assist in the layout of the parent. The ‘‘real children’’ of the parent (i.e. the windows that are significant for the application’s user interface) can be children of the parent yet be placed inside the windows of the geometry-management hierarchy. This means that the path names of the ‘‘real children’’ don’t reflect the geometry-management hierarchy and users can specify options for the real children without being aware of the structure of the geometry-management hierarchy.

A second reason for having a master different than the slave’s parent is to tie two siblings together. For example, the placer can be used to force a window always to be positioned centered just below one of its siblings by specifying the configuration

<B>-inB>=>$sibling, <B>-relxB>=>0.5, <B>-relyB>=>1.0, <B>-anchorB>=>’n’, <B>-bordermodeB>=>’outside’

Whenever the $sibling widget is repositioned in the future, the slave will be repositioned as well.

Unlike many other geometry managers (such as the packer) the placer does not make any attempt to manipulate the geometry of the master windows or the parents of slave windows (i.e. it doesn’t set their requested sizes). To control the sizes of these windows, make them windows like frames and canvases that provide configuration options for this purpose.

SEE ALSO

Tk::form, Tk::grid, Tk::pack

KEYWORDS

geometry manager, height, location, master, place, rubber sheet, slave, width
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 PLACE (3) 2013-11-15

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.