File: class-gtkviewport.html

package info (click to toggle)
pygtk 2.24.0-5.1
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 26,760 kB
  • ctags: 8,260
  • sloc: xml: 182,079; sh: 10,297; python: 10,161; ansic: 2,861; makefile: 1,358
file content (54 lines) | stat: -rw-r--r-- 23,025 bytes parent folder | download | duplicates (3)
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
51
52
53
54
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>gtk.Viewport</title><link rel="stylesheet" href="style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><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="prev" 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" title="gtk.Viewport"><a name="class-gtkviewport"></a><div class="titlepage"></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" title="Synopsis"><a name="id4074443"></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 class="link" href="class-gtkbin.html" title="gtk.Bin">gtk.Bin</a></span></span>):
<code class="constructorsynopsis">    <span class="methodname"><a class="link" href="class-gtkviewport.html#constructor-gtkviewport" title="Constructor">gtk.Viewport</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>hadjustment</code></strong></span><span class="initializer">=None</span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>vadjustment</code></strong></span><span class="initializer">=None</span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" 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 class="link" 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 class="link" href="class-gtkviewport.html#method-gtkviewport--set-hadjustment" title="gtk.Viewport.set_hadjustment">set_hadjustment</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>adjustment</code></strong></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gtkviewport.html#method-gtkviewport--set-vadjustment" title="gtk.Viewport.set_vadjustment">set_vadjustment</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>adjustment</code></strong></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" 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"><strong class="parameter"><code>type</code></strong></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" 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><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gtkviewport.html#method-gtkviewport--get-bin-window" title="gtk.Viewport.get_bin_window">get_bin_window</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gtkviewport.html#method-gtkviewport--get-view-window" title="gtk.Viewport.get_view_window">get_view_window</a></span>(<span class="methodparam"></span>)</code><br></pre></td></tr></table></div><div class="refsect1" title="Ancestry"><a name="id4074705"></a><h2>Ancestry</h2><pre class="synopsis">+-- <PYGTKDOCLINK HREF="class-gobject">gobject.GObject</PYGTKDOCLINK>
  +-- <a class="link" href="class-gtkobject.html" title="gtk.Object">gtk.Object</a>
    +-- <a class="link" href="class-gtkwidget.html" title="gtk.Widget">gtk.Widget</a>
      +-- <a class="link" href="class-gtkcontainer.html" title="gtk.Container">gtk.Container</a>
        +-- <a class="link" href="class-gtkbin.html" title="gtk.Bin">gtk.Bin</a>
          +-- <a class="link" href="class-gtkviewport.html" title="gtk.Viewport">gtk.Viewport</a>
</pre></div><div class="refsect1" title="Implemented Interfaces"><a name="id4074756"></a><h2>Implemented Interfaces</h2><p>
			<a class="link" href="class-gtkviewport.html" title="gtk.Viewport"><code class="classname">gtk.Viewport</code></a>
			implements 
			<a class="link" href="class-gtkbuildable.html" title="gtk.Buildable"><code class="classname">gtk.Buildable</code></a>
		</p></div><div class="refsect1" title="gtk.Viewport Properties"><a name="properties-gtkviewport"></a><h2>gtk.Viewport Properties</h2><p><a class="link" href="class-gtkobject.html#properties-gtkobject" title="gtk.Object Properties">gtk.Object Properties</a></p><p><a class="link" href="class-gtkwidget.html#properties-gtkwidget" title="gtk.Widget Properties">gtk.Widget Properties</a></p><p><a class="link" href="class-gtkcontainer.html#properties-gtkcontainer" title="gtk.Container Properties">gtk.Container Properties</a></p><div class="blockquote"><table width="100%" border="0" bgcolor="#E0E0E0"><tr><td valign="top"><div class="informaltable"><table width="100%" border="0"><colgroup><col width="1in"><col width="1in"><col width="4in"></colgroup><tbody><tr valign="top"><td valign="top">"hadjustment"</td><td valign="top">Read-Write</td><td valign="top">The <a class="link" href="class-gtkadjustment.html" title="gtk.Adjustment"><code class="classname">gtk.Adjustment</code></a>
that determines the values of the horizontal 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:
<code class="literal">gtk.SHADOW_NONE</code>, <code class="literal">gtk.SHADOW_IN</code>,
<code class="literal">gtk.SHADOW_OUT</code>, <code class="literal">gtk.SHADOW_ETCHED_IN</code>
or <code class="literal">gtk.SHADOW_ETCHED_OUT</code></td></tr><tr valign="top"><td valign="top">"vadjustment"</td><td valign="top">Read-Write</td><td valign="top">The <a class="link" href="class-gtkadjustment.html" title="gtk.Adjustment"><code class="classname">gtk.Adjustment</code></a>
that determines the values of the vertical position for this
viewport.</td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" title="gtk.Viewport Style Properties"><a name="style-properties-gtkviewport"></a><h2>gtk.Viewport Style Properties</h2><p><a class="link" href="class-gtkwidget.html#style-properties-gtkwidget" title="gtk.Widget Style Properties">gtk.Widget Style Properties</a></p></div><div class="refsect1" title="gtk.Viewport Signal Prototypes"><a name="signal-prototypes-gtkviewport"></a><h2>gtk.Viewport Signal Prototypes</h2><p><PYGTKDOCLINK HREF="signal-prototypes-gobject">gobject.GObject Signal Prototypes</PYGTKDOCLINK></p><p><a class="link" href="class-gtkobject.html#signal-prototypes-gtkobject" title="gtk.Object Signal Prototypes">gtk.Object Signal Prototypes</a></p><p><a class="link" href="class-gtkwidget.html#signal-prototypes-gtkwidget" title="gtk.Widget Signal Prototypes">gtk.Widget Signal Prototypes</a></p><p><a class="link" href="class-gtkcontainer.html#signal-prototypes-gtkcontainer" title="gtk.Container Signal Prototypes">gtk.Container Signal Prototypes</a></p><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term">"<a class="link" href="class-gtkviewport.html#signal-gtkviewport--set-scroll-adjustments" title='The "set-scroll-adjustments" gtk.Viewport Signal'>set-scroll-adjustments</a>"</span></p></td><td><code class="methodsynopsis">    def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>viewport</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>hadjustment</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>vadjustment</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></td></tr></tbody></table></div><div class="refsect1" title="Description"><a name="id4075113"></a><h2>Description</h2><p>A <a class="link" href="class-gtkviewport.html" title="gtk.Viewport"><code class="classname">gtk.Viewport</code></a>
widget provides a view into a portion of a larger widget. A <a class="link" href="class-gtkviewport.html" title="gtk.Viewport"><code class="classname">gtk.Viewport</code></a> is
usually used to provide adjustment capability for a widget to be used in a
<a class="link" href="class-gtkscrolledwindow.html" title="gtk.ScrolledWindow"><code class="classname">gtk.ScrolledWindow</code></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 class="link" href="class-gtkscrolledwindow.html" title="gtk.ScrolledWindow"><code class="classname">gtk.ScrolledWindow</code></a> 
to make the scrollbars functional. See the <a class="link" href="class-gtkscrolledwindow.html#method-gtkscrolledwindow--add-with-viewport" title="gtk.ScrolledWindow.add_with_viewport"><code class="methodname">gtk.ScrolledWindow.add_with_viewport</code>()</a> 
method for more information.</p></div><div class="refsect1" title="Constructor"><a name="constructor-gtkviewport"></a><h2>Constructor</h2><pre class="programlisting"><code class="constructorsynopsis">    <span class="methodname">gtk.Viewport</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>hadjustment</code></strong></span><span class="initializer">=None</span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>vadjustment</code></strong></span><span class="initializer">=None</span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>hadjustment</code></strong> :</span></p></td><td>a horizontal adjustment.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>vadjustment</code></strong> :</span></p></td><td>a vertical adjustment.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a new <a class="link" href="class-gtkviewport.html" title="gtk.Viewport"><code class="classname">gtk.Viewport</code></a>
widget</td></tr></tbody></table><p>Creates a new <a class="link" href="class-gtkviewport.html" title="gtk.Viewport"><code class="classname">gtk.Viewport</code></a> with
the horizontal and vertical adjustments specified by
<em class="parameter"><code>hadjustment</code></em> and <em class="parameter"><code>vadjustment</code></em>
respectively. If <em class="parameter"><code>hadjustment</code></em> or
<em class="parameter"><code>vadjustment</code></em> is <code class="literal">None</code> a new
adjustment will be created.</p></div><div class="refsect1" title="Methods"><a name="id4075336"></a><h2>Methods</h2><div class="refsect2" title="gtk.Viewport.get_hadjustment"><a name="method-gtkviewport--get-hadjustment"></a><h3>gtk.Viewport.get_hadjustment</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_hadjustment</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the horizontal adjustment</td></tr></tbody></table><p>The <code class="methodname">get_hadjustment</code>() method returns
the value of the "hadjustment" property that contains the horizontal <a class="link" href="class-gtkadjustment.html" title="gtk.Adjustment"><code class="classname">gtk.Adjustment</code></a>
of the viewport.</p></div><div class="refsect2" title="gtk.Viewport.get_vadjustment"><a name="method-gtkviewport--get-vadjustment"></a><h3>gtk.Viewport.get_vadjustment</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_vadjustment</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the vertical adjustment</td></tr></tbody></table><p>The <code class="methodname">get_vadjustment</code>() method returns
the value of the "vadjustment" property that contains the vertical <a class="link" href="class-gtkadjustment.html" title="gtk.Adjustment"><code class="classname">gtk.Adjustment</code></a>
of the viewport.</p></div><div class="refsect2" title="gtk.Viewport.set_hadjustment"><a name="method-gtkviewport--set-hadjustment"></a><h3>gtk.Viewport.set_hadjustment</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_hadjustment</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>adjustment</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>adjustment</code></strong> :</span></p></td><td>a <a class="link" href="class-gtkadjustment.html" title="gtk.Adjustment"><code class="classname">gtk.Adjustment</code></a>.</td></tr></tbody></table><p>The <code class="methodname">set_hadjustment</code>() method sets the
"hadjustment" property to the value of <em class="parameter"><code>adjustment</code></em>
that becomes the horizontal adjustment of the viewport.</p></div><div class="refsect2" title="gtk.Viewport.set_vadjustment"><a name="method-gtkviewport--set-vadjustment"></a><h3>gtk.Viewport.set_vadjustment</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_vadjustment</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>adjustment</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>adjustment</code></strong> :</span></p></td><td>a <a class="link" href="class-gtkadjustment.html" title="gtk.Adjustment"><code class="classname">gtk.Adjustment</code></a>.</td></tr></tbody></table><p>The <code class="methodname">set_vadjustment</code>() method sets the
"vadjustment" property to the value of <em class="parameter"><code>adjustment</code></em>
that becomes the vertical adjustment of the viewport.</p></div><div class="refsect2" title="gtk.Viewport.set_shadow_type"><a name="method-gtkviewport--set-shadow-type"></a><h3>gtk.Viewport.set_shadow_type</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_shadow_type</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>type</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>type</code></strong> :</span></p></td><td>the new shadow type.</td></tr></tbody></table><p>The <code class="methodname">set_shadow_type</code>() method sets the
"shadow-type" property to the value of <em class="parameter"><code>type</code></em>. The
value of <em class="parameter"><code>type</code></em> must be one of:</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><code class="literal">gtk.SHADOW_NONE</code></li><li class="listitem"><code class="literal">gtk.SHADOW_IN</code></li><li class="listitem"><code class="literal">gtk.SHADOW_OUT</code></li><li class="listitem"><code class="literal">gtk.SHADOW_ETCHED_IN</code></li><li class="listitem"><code class="literal">gtk.SHADOW_ETCHED_OUT</code></li></ul></div><p></p></div><div class="refsect2" title="gtk.Viewport.get_shadow_type"><a name="method-gtkviewport--get-shadow-type"></a><h3>gtk.Viewport.get_shadow_type</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_shadow_type</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the shadow type</td></tr></tbody></table><p>The <code class="methodname">get_shadow_type</code>() method returns
the value of the "shadow-type" property that contains the shadow type of the
<a class="link" href="class-gtkviewport.html" title="gtk.Viewport"><code class="classname">gtk.Viewport</code></a>. See
the <a class="link" href="class-gtkviewport.html#method-gtkviewport--set-shadow-type" title="gtk.Viewport.set_shadow_type"><code class="methodname">set_shadow_type</code>()</a> 
method for more information.</p></div><div class="refsect2" title="gtk.Viewport.get_bin_window"><a name="method-gtkviewport--get-bin-window"></a><h3>gtk.Viewport.get_bin_window</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_bin_window</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a <a class="link" href="class-gdkwindow.html" title="gtk.gdk.Window"><code class="classname">gtk.gdk.Window</code></a>.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.22 and above.</p></div><p>The <code class="methodname">get_bin_window</code>() method gets the bin window of the viewport.</p></div><div class="refsect2" title="gtk.Viewport.get_view_window"><a name="method-gtkviewport--get-view-window"></a><h3>gtk.Viewport.get_view_window</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_view_window</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a a <a class="link" href="class-gdkwindow.html" title="gtk.gdk.Window"><code class="classname">gtk.gdk.Window</code></a>.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.22 and above.</p></div><p>The <code class="methodname">get_view_window</code>() method gets the view window of the viewport.</p></div></div><div class="refsect1" title="Signals"><a name="id4076018"></a><h2>Signals</h2><div class="refsect2" title='The "set-scroll-adjustments" gtk.Viewport Signal'><a name="signal-gtkviewport--set-scroll-adjustments"></a><h3>The "set-scroll-adjustments" gtk.Viewport Signal</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>viewport</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>hadjustment</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>vadjustment</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><em class="parameter"><code>viewport</code></em> :</span></p></td><td>the viewport that received the
signal</td></tr><tr><td><p><span class="term"><em class="parameter"><code>hadjustment</code></em> :</span></p></td><td>the horizontal <a class="link" href="class-gtkadjustment.html" title="gtk.Adjustment"><code class="classname">gtk.Adjustment</code></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>vadjustment</code></em> :</span></p></td><td>the vertical <a class="link" href="class-gtkadjustment.html" title="gtk.Adjustment"><code class="classname">gtk.Adjustment</code></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>user_param1</code></em> :</span></p></td><td>the first user parameter (if any) specified
with the <PYGTKDOCLINK HREF="method-gobject--connect"><code class="methodname">connect</code>()</PYGTKDOCLINK>
method</td></tr><tr><td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></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 class="link" href="class-gtkadjustment.html" title="gtk.Adjustment"><code class="classname">gtk.Adjustment</code></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>