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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>gtk.Viewport</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="gtk-class-reference.html" title="The gtk Class Reference"><link rel="previous" href="class-gtkvseparator.html" title="gtk.VSeparator"><link rel="next" href="class-gtkwidget.html" title="gtk.Widget"></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.Viewport</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-gtkvseparator.html">Prev</a></td><th width="60%" align="center">The gtk Class Reference</th><td width="20%" align="right"><a accesskey="n" href="class-gtkwidget.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="class-gtkviewport"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2>gtk.Viewport</h2><p>gtk.Viewport — a widget displaying a portion of a larger
widget.</p></div><div class="refsect1" lang="en"><a name="id3619552"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gtk.Viewport</span></span>(<span class="ooclass"><span class="classname"><a href="class-gtkbin.html" title="gtk.Bin">gtk.Bin</a></span></span>):
<code class="constructorsynopsis"> <span class="methodname"><a href="class-gtkviewport.html#constructor-gtkviewport" title="Constructor">gtk.Viewport</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>hadjustment</tt></b></span><span class="initializer">=None</span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>vadjustment</tt></b></span><span class="initializer">=None</span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkviewport.html#method-gtkviewport--get-hadjustment" title="gtk.Viewport.get_hadjustment">get_hadjustment</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkviewport.html#method-gtkviewport--get-vadjustment" title="gtk.Viewport.get_vadjustment">get_vadjustment</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkviewport.html#method-gtkviewport--set-hadjustment" title="gtk.Viewport.set_hadjustment">set_hadjustment</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>adjustment</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkviewport.html#method-gtkviewport--set-vadjustment" title="gtk.Viewport.set_vadjustment">set_vadjustment</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>adjustment</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkviewport.html#method-gtkviewport--set-shadow-type" title="gtk.Viewport.set_shadow_type">set_shadow_type</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>type</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkviewport.html#method-gtkviewport--get-shadow-type" title="gtk.Viewport.get_shadow_type">get_shadow_type</a></span>(<span class="methodparam"></span>)</code><br></pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id3619724"></a><h2>Ancestry</h2><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="synopsis">+-- <a href="class-gobject.html" title="gobject.GObject">gobject.GObject</a>
+-- <a href="class-gtkobject.html" title="gtk.Object">gtk.Object</a>
+-- <a href="class-gtkwidget.html" title="gtk.Widget">gtk.Widget</a>
+-- <a href="class-gtkcontainer.html" title="gtk.Container">gtk.Container</a>
+-- <a href="class-gtkbin.html" title="gtk.Bin">gtk.Bin</a>
+-- <a href="class-gtkviewport.html" title="gtk.Viewport">gtk.Viewport</a>
</pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id3619773"></a><h2>Properties</h2><div class="blockquote"><table width="100%" border="0" bgcolor="#E0E0E0"><tr><td valign="top"><div class="informaltable"><table width="100%" border="0"><colgroup><col><col><col></colgroup><tbody><tr valign="top"><td valign="top">"hadjustment"</td><td valign="top">Read-Write</td><td valign="top">The <a href="class-gtkadjustment.html" title="gtk.Adjustment"><tt class="classname">gtk.Adjustment</tt></a>
that determines the values of the horizontal position for this
viewport.</td></tr><tr valign="top"><td valign="top">"vadjustment"</td><td valign="top">Read-Write</td><td valign="top">The <a href="class-gtkadjustment.html" title="gtk.Adjustment"><tt class="classname">gtk.Adjustment</tt></a>
that determines the values of the vertical position for this
viewport.</td></tr><tr valign="top"><td valign="top">"shadow-type"</td><td valign="top">Read-Write</td><td valign="top">The type of shadowed box around the viewport:
<tt class="literal">gtk.SHADOW_NONE</tt>, <tt class="literal">gtk.SHADOW_IN</tt>,
<tt class="literal">gtk.SHADOW_OUT</tt>, <tt class="literal">gtk.SHADOW_ETCHED_IN</tt>
or <tt class="literal">gtk.SHADOW_ETCHED_OUT</tt></td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" lang="en"><a name="id3619913"></a><h2>Signal Prototypes</h2><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term">"<a href="class-gtkviewport.html#signal-gtkviewport--set-scroll-adjustments" title='The "set-scroll-adjustments" gtk.Viewport Signal'>set-scroll-adjustments</a>"</span></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>viewport</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>hadjustment</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>vadjustment</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>user_param1</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>...</tt></i></span></span>)</code></td></tr></tbody></table></div><div class="refsect1" lang="en"><a name="id3619975"></a><h2>Description</h2><p>A <a href="class-gtkviewport.html" title="gtk.Viewport"><tt class="classname">gtk.Viewport</tt></a>
widget provides a view into a portion of a larger widget. A <a href="class-gtkviewport.html" title="gtk.Viewport"><tt class="classname">gtk.Viewport</tt></a> is
usually used to provide adjustment capability for a widget to be used in a
<a href="class-gtkscrolledwindow.html" title="gtk.ScrolledWindow"><tt class="classname">gtk.ScrolledWindow</tt></a>.
For example, a label widget doesn't have any adjustments (does not support
the "set-scroll-adjustments" signal) and would need a viewport when added to
a <a href="class-gtkscrolledwindow.html" title="gtk.ScrolledWindow"><tt class="classname">gtk.ScrolledWindow</tt></a>
to make the scrollbars functional. See the <a href="class-gtkscrolledwindow.html#method-gtkscrolledwindow--add-with-viewport" title="gtk.ScrolledWindow.add_with_viewport"><tt class="methodname">gtk.ScrolledWindow.add_with_viewport</tt>()</a>
method for more information.</p></div><div class="refsect1" lang="en"><a name="constructor-gtkviewport"></a><h2>Constructor</h2><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="constructorsynopsis"> <span class="methodname">gtk.Viewport</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>hadjustment</tt></b></span><span class="initializer">=None</span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>vadjustment</tt></b></span><span class="initializer">=None</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>hadjustment</tt></b>:</span></td><td>a horizontal adjustment.</td></tr><tr><td><span class="term"><b class="parameter"><tt>vadjustment</tt></b>:</span></td><td>a vertical adjustment.</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a new <a href="class-gtkviewport.html" title="gtk.Viewport"><tt class="classname">gtk.Viewport</tt></a>
widget</td></tr></tbody></table><p>Creates a new <a href="class-gtkviewport.html" title="gtk.Viewport"><tt class="classname">gtk.Viewport</tt></a> with
the horizontal and vertical adjustments specified by
<i class="parameter"><tt>hadjustment</tt></i> and <i class="parameter"><tt>vadjustment</tt></i>
respectively. If <i class="parameter"><tt>hadjustment</tt></i> or
<i class="parameter"><tt>vadjustment</tt></i> is <tt class="literal">None</tt> a new
adjustment will be created.</p></div><div class="refsect1" lang="en"><a name="id3620167"></a><h2>Methods</h2><div class="refsect2" lang="en"><a name="method-gtkviewport--get-hadjustment"></a><h3>gtk.Viewport.get_hadjustment</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_hadjustment</span>(<span class="methodparam"></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"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the horizontal adjustment</td></tr></tbody></table><p>The <tt class="methodname">get_hadjustment</tt>() method returns
the value of the "hadjustment" property that contains the horizontal <a href="class-gtkadjustment.html" title="gtk.Adjustment"><tt class="classname">gtk.Adjustment</tt></a>
of the viewport.</p></div><div class="refsect2" lang="en"><a name="method-gtkviewport--get-vadjustment"></a><h3>gtk.Viewport.get_vadjustment</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_vadjustment</span>(<span class="methodparam"></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"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the vertical adjustment</td></tr></tbody></table><p>The <tt class="methodname">get_vadjustment</tt>() method returns
the value of the "vadjustment" property that contains the vertical <a href="class-gtkadjustment.html" title="gtk.Adjustment"><tt class="classname">gtk.Adjustment</tt></a>
of the viewport.</p></div><div class="refsect2" lang="en"><a name="method-gtkviewport--set-hadjustment"></a><h3>gtk.Viewport.set_hadjustment</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_hadjustment</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>adjustment</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>adjustment</tt></b>:</span></td><td>a <a href="class-gtkadjustment.html" title="gtk.Adjustment"><tt class="classname">gtk.Adjustment</tt></a>.</td></tr></tbody></table><p>The <tt class="methodname">set_hadjustment</tt>() method sets the
"hadjustment" property to the value of <i class="parameter"><tt>adjustment</tt></i>
that becomes the horizontal adjustment of the viewport.</p></div><div class="refsect2" lang="en"><a name="method-gtkviewport--set-vadjustment"></a><h3>gtk.Viewport.set_vadjustment</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_vadjustment</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>adjustment</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>adjustment</tt></b>:</span></td><td>a <a href="class-gtkadjustment.html" title="gtk.Adjustment"><tt class="classname">gtk.Adjustment</tt></a>.</td></tr></tbody></table><p>The <tt class="methodname">set_vadjustment</tt>() method sets the
"vadjustment" property to the value of <i class="parameter"><tt>adjustment</tt></i>
that becomes the vertical adjustment of the viewport.</p></div><div class="refsect2" lang="en"><a name="method-gtkviewport--set-shadow-type"></a><h3>gtk.Viewport.set_shadow_type</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_shadow_type</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>type</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>type</tt></b>:</span></td><td>the new shadow type.</td></tr></tbody></table><p>The <tt class="methodname">set_shadow_type</tt>() method sets the
"shadow-type" property to the value of <i class="parameter"><tt>type</tt></i>. The
value of <i class="parameter"><tt>type</tt></i> must be one of:</p><div class="itemizedlist"><ul type="disc"><li><tt class="literal">gtk.SHADOW_NONE</tt></li><li><tt class="literal">gtk.SHADOW_IN</tt></li><li><tt class="literal">gtk.SHADOW_OUT</tt></li><li><tt class="literal">gtk.SHADOW_ETCHED_IN</tt></li><li><tt class="literal">gtk.SHADOW_ETCHED_OUT</tt></li></ul></div><p></p></div><div class="refsect2" lang="en"><a name="method-gtkviewport--get-shadow-type"></a><h3>gtk.Viewport.get_shadow_type</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_shadow_type</span>(<span class="methodparam"></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"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the shadow type</td></tr></tbody></table><p>The <tt class="methodname">get_shadow_type</tt>() method returns
the value of the "shadow-type" property that contains the shadow type of the
<a href="class-gtkviewport.html" title="gtk.Viewport"><tt class="classname">gtk.Viewport</tt></a>. See
the <a href="class-gtkviewport.html#method-gtkviewport--set-shadow-type" title="gtk.Viewport.set_shadow_type"><tt class="methodname">set_shadow_type</tt>()</a>
method for more information.</p></div></div><div class="refsect1" lang="en"><a name="id3620627"></a><h2>Signals</h2><div class="refsect2" lang="en"><a name="signal-gtkviewport--set-scroll-adjustments"></a><h3>The "set-scroll-adjustments" gtk.Viewport Signal</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>viewport</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>hadjustment</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>vadjustment</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>user_param1</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>...</tt></i></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"><i class="parameter"><tt>viewport</tt></i>:</span></td><td>the viewport that received the
signal</td></tr><tr><td><span class="term"><i class="parameter"><tt>hadjustment</tt></i>:</span></td><td>the horizontal <a href="class-gtkadjustment.html" title="gtk.Adjustment"><tt class="classname">gtk.Adjustment</tt></a></td></tr><tr><td><span class="term"><i class="parameter"><tt>vadjustment</tt></i>:</span></td><td>the vertical <a href="class-gtkadjustment.html" title="gtk.Adjustment"><tt class="classname">gtk.Adjustment</tt></a></td></tr><tr><td><span class="term"><i class="parameter"><tt>user_param1</tt></i>:</span></td><td>the first user parameter (if any) specified
with the <a href="class-gobject.html#method-gobject--connect" title="gobject.GObject.connect"><tt class="methodname">connect</tt>()</a>
method</td></tr><tr><td><span class="term"><i class="parameter"><tt>...</tt></i>:</span></td><td>additional user parameters (if
any)</td></tr></tbody></table><p>The "set-scroll-adjustments" signal is emitted when one or both
of the horizontal and vertical <a href="class-gtkadjustment.html" title="gtk.Adjustment"><tt class="classname">gtk.Adjustment</tt></a>
objects is changed.</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-gtkvseparator.html">Prev</a></td><td width="20%" align="center"><a accesskey="u" href="gtk-class-reference.html">Up</a></td><td width="40%" align="right"><a accesskey="n" href="class-gtkwidget.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gtk.VSeparator</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">gtk.Widget</td></tr></table></div></body></html>
|