1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>gtk.gdk.Rectangle</title><meta name="generator" content="DocBook XSL Stylesheets V1.65.1"><link rel="home" href="index.html" title="PyGTK 2.0 Reference Manual"><link rel="up" href="gdk-class-reference.html" title="The gtk.gdk Class Reference"><link rel="previous" href="class-gdkpixmap.html" title="gtk.gdk.Pixmap"><link rel="next" href="class-gdkscreen.html" title="gtk.gdk.Screen"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">gtk.gdk.Rectangle</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-gdkpixmap.html">Prev</a></td><th width="60%" align="center">The gtk.gdk Class Reference</th><td width="20%" align="right"><a accesskey="n" href="class-gdkscreen.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="class-gdkrectangle"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2>gtk.gdk.Rectangle</h2><p>gtk.gdk.Rectangle — an object holding data about a rectangle</p></div><div class="refsect1" lang="en"><a name="id3060646"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gtk.gdk.Rectangle</span></span>(<span class="ooclass"><span class="classname">gobject.GBoxed</span></span>):
<code class="constructorsynopsis"> <span class="methodname"><a href="class-gdkrectangle.html#constructor-gdkrectangle" title="Constructor">gtk.gdk.Rectangle</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>x</tt></b></span><span class="initializer">=0</span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>y</tt></b></span><span class="initializer">=0</span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>width</tt></b></span><span class="initializer">=0</span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>height</tt></b></span><span class="initializer">=0</span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gdkrectangle.html#method-gdkrectangle--intersect" title="gtk.gdk.Rectangle.intersect">intersect</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>src</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gdkrectangle.html#method-gdkrectangle--union" title="gtk.gdk.Rectangle.union">union</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>src</tt></b></span></span>)</code><br></pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id2986756"></a><h2>Attributes</h2><div class="blockquote"><table width="100%" border="0" bgcolor="#E0E0E0"><tr><td valign="top"><div class="informaltable"><table cellpadding="5" width="100%" border="0"><colgroup><col><col><col></colgroup><tbody><tr valign="top"><td valign="top">"x"</td><td valign="top">Read-Write</td><td valign="top">The X coordinate of the top left corner of the
rectangle.</td></tr><tr valign="top"><td valign="top">"y"</td><td valign="top">Read-Write</td><td valign="top">The Y coordinate of the top left corner of the
rectangle.</td></tr><tr valign="top"><td valign="top">"width"</td><td valign="top">Read-Write</td><td valign="top">The width of the rectangle.</td></tr><tr valign="top"><td valign="top">"height"</td><td valign="top">Read-Write</td><td valign="top">The height of the rectangle.</td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" lang="en"><a name="id3287744"></a><h2>Description</h2><p>A <a href="class-gdkrectangle.html" title="gtk.gdk.Rectangle"><tt class="classname">gtk.gdk.Rectangle</tt></a>
holds the position and size of a rectangle. The position is specified by the
"x" and "y" attributes and the size, by the "width" and "height"
attributes.</p></div><div class="refsect1" lang="en"><a name="constructor-gdkrectangle"></a><h2>Constructor</h2><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="constructorsynopsis"> <span class="methodname">gtk.gdk.Rectangle</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>x</tt></b></span><span class="initializer">=0</span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>y</tt></b></span><span class="initializer">=0</span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>width</tt></b></span><span class="initializer">=0</span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>height</tt></b></span><span class="initializer">=0</span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>x</tt></b>:</span></td><td>the X coordinate of the top left corner of the
rectangle</td></tr><tr><td><span class="term"><b class="parameter"><tt>y</tt></b>:</span></td><td>the Y coordinate of the top left corner of the
rectangle</td></tr><tr><td><span class="term"><b class="parameter"><tt>width</tt></b>:</span></td><td>the width of the rectangle</td></tr><tr><td><span class="term"><b class="parameter"><tt>height</tt></b>:</span></td><td>the height of the rectangle</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a new <a href="class-gdkrectangle.html" title="gtk.gdk.Rectangle"><tt class="classname">gtk.gdk.Rectangle</tt></a>
object</td></tr></tbody></table><p>Creates a new <a href="class-gdkrectangle.html" title="gtk.gdk.Rectangle"><tt class="classname">gtk.gdk.Rectangle</tt></a>
with the attributes specified by <i class="parameter"><tt>x</tt></i>,
<i class="parameter"><tt>y</tt></i>, <i class="parameter"><tt>width</tt></i> and
<i class="parameter"><tt>height</tt></i>. Any unspecified attributes default to
0.</p></div><div class="refsect1" lang="en"><a name="id3151954"></a><h2>Methods</h2><div class="refsect2" lang="en"><a name="method-gdkrectangle--intersect"></a><h3>gtk.gdk.Rectangle.intersect</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">intersect</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>src</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>src</tt></b>:</span></td><td>a <a href="class-gdkrectangle.html" title="gtk.gdk.Rectangle"><tt class="classname">gtk.gdk.Rectangle</tt></a>
of a 4-tuple specifying the attributes of a rectangle as (x, y, width,
height)</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a <a href="class-gdkrectangle.html" title="gtk.gdk.Rectangle"><tt class="classname">gtk.gdk.Rectangle</tt></a>
that is the intersection of <i class="parameter"><tt>src</tt></i> and the
rectangle</td></tr></tbody></table><p>The <tt class="methodname">intersect</tt>() method returns a <a href="class-gdkrectangle.html" title="gtk.gdk.Rectangle"><tt class="classname">gtk.gdk.Rectangle</tt></a>
that is the intersection of this rectangle and the <a href="class-gdkrectangle.html" title="gtk.gdk.Rectangle"><tt class="classname">gtk.gdk.Rectangle</tt></a>
specified by <i class="parameter"><tt>src</tt></i>. The value of
<i class="parameter"><tt>src</tt></i> is either a <a href="class-gdkrectangle.html" title="gtk.gdk.Rectangle"><tt class="classname">gtk.gdk.Rectangle</tt></a>
or a 4-tuple containing the position and size of a rectangle. If the
rectangles do not intersect the returned <a href="class-gdkrectangle.html" title="gtk.gdk.Rectangle"><tt class="classname">gtk.gdk.Rectangle</tt></a>
will have all attributes set to 0.</p></div><div class="refsect2" lang="en"><a name="method-gdkrectangle--union"></a><h3>gtk.gdk.Rectangle.union</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">union</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>src</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>src</tt></b>:</span></td><td>a <a href="class-gdkrectangle.html" title="gtk.gdk.Rectangle"><tt class="classname">gtk.gdk.Rectangle</tt></a>
of a 4-tuple specifying the attributes of a rectangle as (x, y, width,
height)</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a <a href="class-gdkrectangle.html" title="gtk.gdk.Rectangle"><tt class="classname">gtk.gdk.Rectangle</tt></a>
that includes both <i class="parameter"><tt>src</tt></i> and the
rectangle</td></tr></tbody></table><p>The <tt class="methodname">union</tt>() method returns a <a href="class-gdkrectangle.html" title="gtk.gdk.Rectangle"><tt class="classname">gtk.gdk.Rectangle</tt></a>
that is the smallest rectangle containing both this rectangle and the <a href="class-gdkrectangle.html" title="gtk.gdk.Rectangle"><tt class="classname">gtk.gdk.Rectangle</tt></a>
specified by <i class="parameter"><tt>src</tt></i>. The value of
<i class="parameter"><tt>src</tt></i> is either a <a href="class-gdkrectangle.html" title="gtk.gdk.Rectangle"><tt class="classname">gtk.gdk.Rectangle</tt></a>
or a 4-tuple containing the position and size of a rectangle.</p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="class-gdkpixmap.html">Prev</a></td><td width="20%" align="center"><a accesskey="u" href="gdk-class-reference.html">Up</a></td><td width="40%" align="right"><a accesskey="n" href="class-gdkscreen.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gtk.gdk.Pixmap</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">gtk.gdk.Screen</td></tr></table></div></body></html>
|