Sophie

Sophie

distrib > Mageia > 7 > i586 > by-pkgid > 9451edd25456e3a771e4c01f92dd0fc3 > files > 165

gcl-2.6.12-7.mga7.i586.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
<head>
<title>GCL TK Manual: place</title>

<meta name="description" content="GCL TK Manual: place">
<meta name="keywords" content="GCL TK Manual: place">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="wm.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Control.html#Control" rel="up" title="Control">
<link href="raise.html#raise" rel="next" title="raise">
<link href="pack.html#pack" rel="prev" title="pack">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.indentedblock {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
div.smalllisp {margin-left: 3.2em}
kbd {font-style:oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nocodebreak {white-space:nowrap}
span.nolinebreak {white-space:nowrap}
span.roman {font-family:serif; font-weight:normal}
span.sansserif {font-family:sans-serif; font-weight:normal}
ul.no-bullet {list-style: none}
-->
</style>


</head>

<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<a name="place"></a>
<div class="header">
<p>
Next: <a href="raise.html#raise" accesskey="n" rel="next">raise</a>, Previous: <a href="pack.html#pack" accesskey="p" rel="prev">pack</a>, Up: <a href="Control.html#Control" accesskey="u" rel="up">Control</a> &nbsp; [<a href="wm.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>
<hr>
<a name="place-1"></a>
<h3 class="section">3.15 place</h3>

<p>place \- Geometry manager for fixed or rubber-sheet placement
</p><a name="Synopsis-28"></a>
<h4 class="unnumberedsubsec">Synopsis</h4>
<p><b>place </b><i>window option value </i><span class="roman">?</span><i>option value ...</i>?
</p><br>
<p><b>place configure </b><i>window option value </i><span class="roman">?</span><i>option value ...</i>?
</p><br>
<p><b>place forget </b><i>window</i>
</p><br>
<p><b>place info </b><i>window</i>
</p><br>
<p><b>place slaves </b><i>window</i>
</p>
<a name="Description-26"></a>
<h4 class="unnumberedsubsec">Description</h4>

<p>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 <i>slave</i>,
within another window, called the <i>master</i>.
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.
</p>
<p>If the first argument to the <b>place</b> command is a window path
name or <b>configure</b> then the command arranges for the placer
to manage the geometry of a slave whose path name is <i>window</i>.
The remaining arguments consist of one or more <i>option:value</i>
pairs that specify the way in which <i>window</i>&rsquo;s
geometry is managed.
If the placer is already managing <i>window</i>, then the
<i>option:value</i><span class="roman"> pairs modify the configuration for </span><i>window</i>.
In this form the <b>place</b> command returns an empty string as result.
The following <i>option:value</i> pairs are supported:
</p>
<dl compact="compact">
<dt><b>:in </b><i>master</i></dt>
<dd><p><i>Master</i> specifes the path name of the window relative
to which <i>window</i> is to be placed.
<i>Master</i><span class="roman"> must either be </span><i>window</i>&rsquo;s parent or a descendant
of <i>window</i>&rsquo;s parent.
In addition, <i>master</i><span class="roman"> and </span><i>window</i> must both be descendants
of the same top-level window.
These restrictions are necessary to guarantee
that <i>window</i><span class="roman"> is visible whenever </span><i>master</i> is visible.
If this option isn&rsquo;t specified then the master defaults to
<i>window</i>&rsquo;s parent.
</p></dd>
<dt><b>:x </b><i>location</i></dt>
<dd><p><i>Location</i> specifies the x-coordinate within the master window
of the anchor point for <i>window</i>.
The location is specified in screen units (i.e. any of the forms
accepted by <b>Tk_GetPixels</b>) and need not lie within the bounds
of the master window.
</p></dd>
<dt><b>:relx </b><i>location</i></dt>
<dd><p><i>Location</i> specifies the x-coordinate within the master window
of the anchor point for <i>window</i>.
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.
<i>Location</i> need not be in the range 0.0\-1.0.
</p></dd>
<dt><b>:y </b><i>location</i></dt>
<dd><p><i>Location</i> specifies the y-coordinate within the master window
of the anchor point for <i>window</i>.
The location is specified in screen units (i.e. any of the forms
accepted by <b>Tk_GetPixels</b>) and need not lie within the bounds
of the master window.
</p></dd>
<dt><b>:rely </b><i>location</i></dt>
<dd><p><i>Location</i> specifies the y-coordinate within the master window
of the anchor point for <i>window</i>.
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.
<i>Location</i> need not be in the range 0.0\-1.0.
</p></dd>
<dt><b>:anchor </b><i>where</i></dt>
<dd><p><i>Where</i><span class="roman"> specifies which point of </span><i>window</i> is to be positioned
at the (x,y) location selected by the <b>:x</b><span class="roman">, </span><b>:y</b>,
<b>:relx</b><span class="roman">, and </span><b>:rely</b> options.
The anchor point is in terms of the outer area of <i>window</i>
including its border, if any.
Thus if <i>where</i><span class="roman"> is </span><b>se</b> then the lower-right corner of
<i>window</i>&rsquo;s border will appear at the given (x,y) location
in the master.
The anchor position defaults to <b>nw</b>.
</p></dd>
<dt><b>:width </b><i>size</i></dt>
<dd><p><i>Size</i><span class="roman"> specifies the width for </span><i>window</i> in screen units
(i.e. any of the forms accepted by <b>Tk_GetPixels</b>).
The width will be the outer width of <i>window</i> including its
border, if any.
If <i>size</i><span class="roman"> is an empty string, or if no </span><b>:width</b>
or <b>:relwidth</b> option is specified, then the width requested
internally by the window will be used.
</p></dd>
<dt><b>:relwidth </b><i>size</i></dt>
<dd><p><i>Size</i><span class="roman"> specifies the width for </span><i>window</i>.
In this case the width is specified as a floating-point number
relative to the width of the master: 0.5 means <i>window</i> will
be half as wide as the master, 1.0 means <i>window</i> will have
the same width as the master, and so on.
</p></dd>
<dt><b>:height </b><i>size</i></dt>
<dd><p><i>Size</i><span class="roman"> specifies the height for </span><i>window</i> in screen units
(i.e. any of the forms accepted by <b>Tk_GetPixels</b>).
The height will be the outer dimension of <i>window</i> including its
border, if any.
If <i>size</i><span class="roman"> is an empty string, or if no </span><b>:height</b> or
<b>:relheight</b> option is specified, then the height requested
internally by the window will be used.
</p></dd>
<dt><b>:relheight </b><i>size</i></dt>
<dd><p><i>Size</i><span class="roman"> specifies the height for </span><i>window</i>.
In this case the height is specified as a floating-point number
relative to the height of the master: 0.5 means <i>window</i> will
be half as high as the master, 1.0 means <i>window</i> will have
the same height as the master, and so on.
</p></dd>
<dt><b>:bordermode </b><i>mode</i></dt>
<dd><p><i>Mode</i> 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>inside</b>.
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>:x 0</b> corresponds to an x-coordinate just
inside the border and an option of <b>:relwidth 1.0</b>
means <i>window</i> will fill the area inside the master&rsquo;s
border.
If <i>mode</i><span class="roman"> is </span><b>outside</b> then the placer considers
the area of the master to include its border;
this mode is typically used when placing <i>window</i>
outside its master, as with the options <b>:x 0 :y 0 :anchor ne</b>.
Lastly, <i>mode</i><span class="roman"> may be specified as </span><b>ignore</b>, 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>ignore</b> is probably
not very useful.
</p>
<p>If the same value is specified separately with
two different options, such as <b>:x</b><span class="roman"> and </span><b>:relx</b>, then
the most recent option is used and the older one is ignored.
</p>
<p>The <b>place slaves</b> command returns a list of all the slave
windows for which <i>window</i> is the master.
If there are no slaves for <i>window</i> then an empty string is
returned.
</p>
<p>The <b>place forget</b> command causes the placer to stop managing
the geometry of <i>window</i>.  As a side effect of this command
<i>window</i> will be unmapped so that it doesn&rsquo;t appear on the
screen.
If <i>window</i> isn&rsquo;t currently managed by the placer then the
command has no effect.
<b>Place forget</b> returns an empty string as result.
</p>
<p>The <b>place info</b> command returns a list giving the current
configuration of <i>window</i>.
The list consists of <i>option:value</i> pairs in exactly the
same form as might be specified to the <b>place configure</b>
command.
If the configuration of a window has been retrieved with
<b>place info</b>, that configuration can be restored later by
first using <b>place forget</b> to erase any existing information
for the window and then invoking <b>place configure</b> with
the saved information.
</p>
</dd>
</dl>
<a name="g_t_0022Fine-Points_0022"></a>
<h4 class="unnumberedsubsec">&quot;Fine Points&quot;</h4>

<p>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 &ldquo;real children&rdquo; of the parent (i.e. the windows that
are significant for the application&rsquo;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 &ldquo;real children&rdquo;
don&rsquo;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.
</p>
<p>A second reason for having a master different than the slave&rsquo;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
</p>
<div class="example">
<pre class="example"><b>:in </b><i>sibling</i><b> :relx 0.5 :rely 1.0 :anchor n :bordermode outside</b>
</pre></div>

<p>Whenever the sibling is repositioned in the future, the slave
will be repositioned as well.
</p>
<p>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&rsquo;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.
</p>
<a name="Keywords-29"></a>
<h4 class="unnumberedsubsec">Keywords</h4>
<p>geometry manager, height, location, master, place, rubber sheet, slave, width
</p><hr>
<div class="header">
<p>
Next: <a href="raise.html#raise" accesskey="n" rel="next">raise</a>, Previous: <a href="pack.html#pack" accesskey="p" rel="prev">pack</a>, Up: <a href="Control.html#Control" accesskey="u" rel="up">Control</a> &nbsp; [<a href="wm.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>



</body>
</html>