File: class-gtkscrolledwindow.html

package info (click to toggle)
python-gtk2-doc 2.5.2-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 8,304 kB
  • ctags: 3,741
  • sloc: makefile: 38
file content (160 lines) | stat: -rw-r--r-- 39,280 bytes parent folder | download
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>gtk.ScrolledWindow</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-gtkscrollbar.html" title="gtk.Scrollbar"><link rel="next" href="class-gtkselectiondata.html" title="gtk.SelectionData"></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.ScrolledWindow</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-gtkscrollbar.html">Prev</a></td><th width="60%" align="center">The gtk Class Reference</th><td width="20%" align="right"><a accesskey="n" href="class-gtkselectiondata.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="class-gtkscrolledwindow"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2>gtk.ScrolledWindow</h2><p>gtk.ScrolledWindow &#8212; adds scrollbars to its child widget.</p></div><div class="refsect1" lang="en"><a name="id3496123"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gtk.ScrolledWindow</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-gtkscrolledwindow.html#constructor-gtkscrolledwindow" title="Constructor">gtk.ScrolledWindow</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-gtkscrolledwindow.html#method-gtkscrolledwindow--set-hadjustment" title="gtk.ScrolledWindow.set_hadjustment">set_hadjustment</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>hadjustment</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gtkscrolledwindow.html#method-gtkscrolledwindow--set-vadjustment" title="gtk.ScrolledWindow.set_vadjustment">set_vadjustment</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>hadjustment</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gtkscrolledwindow.html#method-gtkscrolledwindow--get-hadjustment" title="gtk.ScrolledWindow.get_hadjustment">get_hadjustment</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gtkscrolledwindow.html#method-gtkscrolledwindow--get-vadjustment" title="gtk.ScrolledWindow.get_vadjustment">get_vadjustment</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gtkscrolledwindow.html#method-gtkscrolledwindow--set-policy" title="gtk.ScrolledWindow.set_policy">set_policy</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>hscrollbar_policy</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>vscrollbar_policy</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gtkscrolledwindow.html#method-gtkscrolledwindow--get-policy" title="gtk.ScrolledWindow.get_policy">get_policy</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>hscrollbar_policy</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>vscrollbar_policy</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gtkscrolledwindow.html#method-gtkscrolledwindow--set-placement" title="gtk.ScrolledWindow.set_placement">set_placement</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>window_placement</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gtkscrolledwindow.html#method-gtkscrolledwindow--get-placement" title="gtk.ScrolledWindow.get_placement">get_placement</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gtkscrolledwindow.html#method-gtkscrolledwindow--set-shadow-type" title="gtk.ScrolledWindow.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-gtkscrolledwindow.html#method-gtkscrolledwindow--get-shadow-type" title="gtk.ScrolledWindow.get_shadow_type">get_shadow_type</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gtkscrolledwindow.html#method-gtkscrolledwindow--add-with-viewport" title="gtk.ScrolledWindow.add_with_viewport">add_with_viewport</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>child</tt></b></span></span>)</code><br></pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id3496407"></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-gtkscrolledwindow.html" title="gtk.ScrolledWindow">gtk.ScrolledWindow</a>
</pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id3496455"></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-Construct</td><td valign="top">The <a href="class-gtkadjustment.html" title="gtk.Adjustment"><tt class="classname">gtk.Adjustment</tt></a>
for the horizontal position.</td></tr><tr valign="top"><td valign="top">hscrollbar-policy""</td><td valign="top">Read-Write</td><td valign="top">The horizontal scrollbar display policy; one of:
<tt class="literal">gtk.POLICY_ALWAYS</tt>,
<tt class="literal">gtk.POLICY_AUTOMATIC</tt> or
<tt class="literal">gtk.POLICY_NEVER</tt>.</td></tr><tr valign="top"><td valign="top">"shadow-type"</td><td valign="top">Read-Write</td><td valign="top">The style of bevel around the contents; one of:
<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>,
<tt class="literal">gtk.SHADOW_ETCHED_OUT</tt>.</td></tr><tr valign="top"><td valign="top">"vadjustment"</td><td valign="top">Read-Write-Construct</td><td valign="top">The <a href="class-gtkadjustment.html" title="gtk.Adjustment"><tt class="classname">gtk.Adjustment</tt></a>
for the vertical position.</td></tr><tr valign="top"><td valign="top">"vscrollbar-policy"</td><td valign="top">Read-Write</td><td valign="top">The vertical scrollbar display policy; one of:
<tt class="literal">gtk.POLICY_ALWAYS</tt>,
<tt class="literal">gtk.POLICY_AUTOMATIC</tt> or
<tt class="literal">gtk.POLICY_NEVER</tt>.</td></tr><tr valign="top"><td valign="top">"window-placement"</td><td valign="top">Read-Write</td><td valign="top">Where the contents are located with respect to the
scrollbars; one of: <tt class="literal">gtk.CORNER_TOP_LEFT</tt>,
<tt class="literal">gtk.CORNER_BOTTOM_LEFT</tt>,
<tt class="literal">gtk.CORNER_TOP_RIGHT</tt>,
<tt class="literal">gtk.CORNER_BOTTOM_RIGHT</tt>.</td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" lang="en"><a name="id3496689"></a><h2>Style 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">"scrollbar-spacing"</td><td valign="top">Read</td><td valign="top">The number of pixels between the scrollbars and the
	      scrolled window. Available in <tt class="literal">GTK+</tt> 2.2 and
	      above.</td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" lang="en"><a name="id3496764"></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-gtkscrolledwindow.html#signal-gtkscrolledwindow--move-focus-out" title='The "move-focus-out" gtk.ScrolledWindow Signal'>move-focus-out</a>"</span></td><td><code class="methodsynopsis">    def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>scrolledwindow</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>direction</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><tr><td><span class="term">"<a href="class-gtkscrolledwindow.html#signal-gtkscrolledwindow--scroll-child" title='The "scroll-child" gtk.ScrolledWindow Signal'>scroll-child</a>"</span></td><td><code class="methodsynopsis">    def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>scrolledwindow</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>scrolltype</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>horizontal</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="id3496873"></a><h2>Description</h2><p>A <a href="class-gtkscrolledwindow.html" title="gtk.ScrolledWindow"><tt class="classname">gtk.ScrolledWindow</tt></a> 
is a subclass of <a href="class-gtkbin.html" title="gtk.Bin"><tt class="classname">gtk.Bin</tt></a> that  adds
scrollbars to a single child widget and optionally draws a beveled frame
around the child widget. The scrolled window can work in two ways:</p><div class="itemizedlist"><ul type="disc"><li>Some widgets have native scrolling support using "slots" to
hold <a href="class-gtkadjustment.html" title="gtk.Adjustment"><tt class="classname">gtk.Adjustment</tt></a>
objects. Widgets with native scroll support include <a href="class-gtktreeview.html" title="gtk.TreeView"><tt class="classname">gtk.TreeView</tt></a>,
<a href="class-gtktextview.html" title="gtk.TextView"><tt class="classname">gtk.TextView</tt></a>, and
<a href="class-gtklayout.html" title="gtk.Layout"><tt class="classname">gtk.Layout</tt></a>.</li><li>Widgets that lack native scrolling support use the <a href="class-gtkviewport.html" title="gtk.Viewport"><tt class="classname">gtk.Viewport</tt></a>
widget that acts as an adapter class, implementing scrollability for child
widgets that lack their own scrolling capabilities. Use <a href="class-gtkviewport.html" title="gtk.Viewport"><tt class="classname">gtk.Viewport</tt></a> to
scroll child widgets such as <a href="class-gtktable.html" title="gtk.Table"><tt class="classname">gtk.Table</tt></a>, <a href="class-gtkbox.html" title="gtk.Box"><tt class="classname">gtk.Box</tt></a>, and so
on.</li></ul></div><p>If a widget has native scrolling abilities, it can be added to the
<a href="class-gtkscrolledwindow.html" title="gtk.ScrolledWindow"><tt class="classname">gtk.ScrolledWindow</tt></a> 
with the <a href="class-gtkcontainer.html#method-gtkcontainer--add" title="gtk.Container.add"><tt class="methodname">gtk.Container.add</tt>()</a> 
method. If a widget does not, you must first add the widget to a <a href="class-gtkviewport.html" title="gtk.Viewport"><tt class="classname">gtk.Viewport</tt></a>, then
add the <a href="class-gtkviewport.html" title="gtk.Viewport"><tt class="classname">gtk.Viewport</tt></a> to
the scrolled window. The convenience method <a href="class-gtkscrolledwindow.html#method-gtkscrolledwindow--add-with-viewport" title="gtk.ScrolledWindow.add_with_viewport"><tt class="methodname">add_with_viewport</tt>()</a> 
does exactly this, so you can ignore the presence of the viewport.</p><p>The position of the scrollbars is controlled by the scroll
adjustments. The <a href="class-gtkscrolledwindow.html" title="gtk.ScrolledWindow"><tt class="classname">gtk.ScrolledWindow</tt></a> 
uses the attributes in an adjustment (see <a href="class-gtkadjustment.html" title="gtk.Adjustment"><tt class="classname">gtk.Adjustment</tt></a>)
as follows:</p><div class="itemizedlist"><ul type="disc"><li>the <tt class="literal">adjustment.lower</tt> attribute is the
minimum value of the scroll region</li><li>the <tt class="literal">adjustment.upper</tt> attribute is the
maximum value of the scroll region</li><li>the <tt class="literal">adjustment.value</tt> attribute
represents the position of the scrollbar, which must be between
<tt class="literal">adjustment.lower</tt> and <tt class="literal">adjustment.upper</tt>
- <tt class="literal">adjustment.page_size</tt></li><li>the <tt class="literal">adjustment.page_size</tt> attribute
represents the size of the visible scrollable area</li><li>the <tt class="literal">adjustment.step_increment</tt> attribute
is the distance to scroll when the small stepper arrows are
clicked</li><li>the <tt class="literal">adjustment.page_increment</tt> attribute
is the distance to scroll when the <span><b class="keycap">Page Up</b></span> or <span><b class="keycap">Page
Down</b></span> keys are pressed</li></ul></div><p>If a <a href="class-gtkscrolledwindow.html" title="gtk.ScrolledWindow"><tt class="classname">gtk.ScrolledWindow</tt></a> 
doesn't behave quite as you would like, or doesn't have exactly the right
layout, it's very possible to set up your own scrolling with <a href="class-gtkscrollbar.html" title="gtk.Scrollbar"><tt class="classname">gtk.Scrollbar</tt></a> and
for example a <a href="class-gtktable.html" title="gtk.Table"><tt class="classname">gtk.Table</tt></a>.</p></div><div class="refsect1" lang="en"><a name="constructor-gtkscrolledwindow"></a><h2>Constructor</h2><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="constructorsynopsis">    <span class="methodname">gtk.ScrolledWindow</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>the horizontal <a href="class-gtkadjustment.html" title="gtk.Adjustment"><tt class="classname">gtk.Adjustment</tt></a>
or None</td></tr><tr><td><span class="term"><b class="parameter"><tt>vadjustment</tt></b>:</span></td><td>a
vertical <a href="class-gtkadjustment.html" title="gtk.Adjustment"><tt class="classname">gtk.Adjustment</tt></a>
or None</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a new <a href="class-gtkscrolledwindow.html" title="gtk.ScrolledWindow"><tt class="classname">gtk.ScrolledWindow</tt></a> 
widget</td></tr></tbody></table><p>Creates a new scrolled window with the horizontal and vertical
<a href="class-gtkadjustment.html" title="gtk.Adjustment"><tt class="classname">gtk.Adjustment</tt></a>
specified by <i class="parameter"><tt>hadjustment</tt></i> and
<i class="parameter"><tt>vadjustment</tt></i> respectively. These will be shared with
the scrollbars and the child widget to keep the bars in sync with the child.
If <i class="parameter"><tt>hadjustment</tt></i> and <i class="parameter"><tt>vadjustment</tt></i>
are <tt class="literal">None</tt> or not specified the scrolled window will create
them for you.</p></div><div class="refsect1" lang="en"><a name="id3497328"></a><h2>Methods</h2><div class="refsect2" lang="en"><a name="method-gtkscrolledwindow--set-hadjustment"></a><h3>gtk.ScrolledWindow.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>hadjustment</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>hadjustment</tt></b>:</span></td><td>the horizontal <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
horizontal adjustment (and the "hadjustment" property) to the value of
<i class="parameter"><tt>hadjustment</tt></i>. <i class="parameter"><tt>hadjustment</tt></i> must
be a <a href="class-gtkadjustment.html" title="gtk.Adjustment"><tt class="classname">gtk.Adjustment</tt></a>.</p></div><div class="refsect2" lang="en"><a name="method-gtkscrolledwindow--set-vadjustment"></a><h3>gtk.ScrolledWindow.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>hadjustment</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>hadjustment</tt></b>:</span></td><td>the vertical <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
vertical adjustment (and the "vadjustment" property) to the value of
<i class="parameter"><tt>vadjustment</tt></i>. <i class="parameter"><tt>vadjustment</tt></i> must
be a <a href="class-gtkadjustment.html" title="gtk.Adjustment"><tt class="classname">gtk.Adjustment</tt></a>.</p></div><div class="refsect2" lang="en"><a name="method-gtkscrolledwindow--get-hadjustment"></a><h3>gtk.ScrolledWindow.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 <a href="class-gtkadjustment.html" title="gtk.Adjustment"><tt class="classname">gtk.Adjustment</tt></a></td></tr></tbody></table><p>The <tt class="methodname">get_hadjustment</tt>() method returns
the value of the "hadjustment" property which is a reference to the
horizontal adjustment.</p></div><div class="refsect2" lang="en"><a name="method-gtkscrolledwindow--get-vadjustment"></a><h3>gtk.ScrolledWindow.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 <a href="class-gtkadjustment.html" title="gtk.Adjustment"><tt class="classname">gtk.Adjustment</tt></a></td></tr></tbody></table><p>The <tt class="methodname">get_vadjustment</tt>() method returns
the value of the "vadjustment" property which is a reference to the vertical
adjustment.</p></div><div class="refsect2" lang="en"><a name="method-gtkscrolledwindow--set-policy"></a><h3>gtk.ScrolledWindow.set_policy</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_policy</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>hscrollbar_policy</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>vscrollbar_policy</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>hscrollbar_policy</tt></b>:</span></td><td>the policy for the horizontal
scrollbar</td></tr><tr><td><span class="term"><b class="parameter"><tt>vscrollbar_policy</tt></b>:</span></td><td>the policy for the vertical
scrollbar</td></tr></tbody></table><p>The <tt class="methodname">set_policy</tt>() method sets the
"hscrollbar_policy" and "vscrollbar_policy" properties to the value of
<i class="parameter"><tt>hscrollbar_policy</tt></i> and
<i class="parameter"><tt>vscrollbar_policy</tt></i> respectively. The policy determines
when the scrollbar should be displayed. The policy value is one of:</p><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term">gtk.POLICY_ALWAYS</span></td><td>the scrollbar is always present</td></tr><tr><td><span class="term">gtk.POLICY_AUTOMATIC</span></td><td>the scrollbar is present only if needed i.e. the
contents are larget than the window</td></tr><tr><td><span class="term">gtk.POLICY_NEVER</span></td><td>the scrollbar is never present</td></tr></tbody></table><p></p></div><div class="refsect2" lang="en"><a name="method-gtkscrolledwindow--get-policy"></a><h3>gtk.ScrolledWindow.get_policy</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_policy</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>&gt;:</span></td><td>a tuple containing the horizontal and vertical
scrollbar policies</td></tr></tbody></table><p>The <tt class="methodname">get_policy</tt>() method returns a tuple
containing the horizontal and vertical scrollbar policies. See the <a href="class-gtkscrolledwindow.html#method-gtkscrolledwindow--set-policy" title="gtk.ScrolledWindow.set_policy"><tt class="methodname">set_policy</tt>()</a> method for more detail.</p></div><div class="refsect2" lang="en"><a name="method-gtkscrolledwindow--set-placement"></a><h3>gtk.ScrolledWindow.set_placement</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_placement</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>window_placement</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>window_placement</tt></b>:</span></td><td>the placement of the contents with respect to
the scrollbars</td></tr></tbody></table><p>The <tt class="methodname">set_placement</tt>() method sets the
"window-placement" property to the value specified by
<i class="parameter"><tt>window_placement</tt></i>. The window placement determines the
location of the child widget with respect to the scrollbars.
<i class="parameter"><tt>window_placement</tt></i> must be one of:</p><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term">gtk.CORNER_TOP_LEFT</span></td><td>Place the scrollbars on the right and bottom of the
widget (default behavior).</td></tr><tr><td><span class="term">gtk.CORNER_BOTTOM_LEFT</span></td><td>Place the scrollbars on the top and right of the
widget.</td></tr><tr><td><span class="term">gtk.CORNER_TOP_RIGHT</span></td><td>Place the scrollbars on the left and bottom of the
widget.</td></tr><tr><td><span class="term">gtk.CORNER_BOTTOM_RIGHT</span></td><td>Place the scrollbars on the top and left of the
widget.</td></tr></tbody></table><p></p></div><div class="refsect2" lang="en"><a name="method-gtkscrolledwindow--get-placement"></a><h3>gtk.ScrolledWindow.get_placement</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_placement</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 current placement
value.</td></tr></tbody></table><p>The <tt class="methodname">get_placement</tt>() method returns the
value of the "window-placement" property that determines the placement of
the scrollbars with respect to the scrolled window. See the <a href="class-gtkscrolledwindow.html#method-gtkscrolledwindow--set-placement" title="gtk.ScrolledWindow.set_placement"><tt class="methodname">set_placement</tt>()</a> 
method for more detail.</p></div><div class="refsect2" lang="en"><a name="method-gtkscrolledwindow--set-shadow-type"></a><h3>gtk.ScrolledWindow.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 kind of bevel shadow to draw around the
scrolled window contents</td></tr></tbody></table><p>The <tt class="methodname">set_shadow_type</tt>() method sets the
value of the "shadow-type" property to the value of
<i class="parameter"><tt>shadow_type</tt></i>. <i class="parameter"><tt>shadow_type</tt></i>
determines the type of bevel shadow drawn around the contents of the
scrolled window. The shadow type must be one of:</p><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term">gtk.SHADOW_NONE</span></td><td>No outline.</td></tr><tr><td><span class="term">gtk.SHADOW_IN</span></td><td>The outline is beveled inward.</td></tr><tr><td><span class="term">gtk.SHADOW_OUT</span></td><td>The outline is beveled outward.</td></tr><tr><td><span class="term">gtk.SHADOW_ETCHED_IN</span></td><td>The outline is an inward etched bevel.</td></tr><tr><td><span class="term">gtk.SHADOW_ETCHED_OUT</span></td><td>The outline is an outward etched bevel.</td></tr></tbody></table><p></p></div><div class="refsect2" lang="en"><a name="method-gtkscrolledwindow--get-shadow-type"></a><h3>gtk.ScrolledWindow.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 current 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 determines the shadow type of
the scrolled window. See the <a href="class-gtkscrolledwindow.html#method-gtkscrolledwindow--set-shadow-type" title="gtk.ScrolledWindow.set_shadow_type"><tt class="methodname">set_shadow_type</tt>()</a> 
method for more detail.</p></div><div class="refsect2" lang="en"><a name="method-gtkscrolledwindow--add-with-viewport"></a><h3>gtk.ScrolledWindow.add_with_viewport</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">add_with_viewport</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>child</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>child</tt></b>:</span></td><td>the widget to be scrolled</td></tr></tbody></table><p>The <tt class="methodname">add_with_viewport</tt>() method is used
to add a widget (specified by <i class="parameter"><tt>child</tt></i>) without native
scrolling capabilities to the scrolled window. This is a convenience
function that is equivalent to adding <i class="parameter"><tt>child</tt></i> to a
<a href="class-gtkviewport.html" title="gtk.Viewport"><tt class="classname">gtk.Viewport</tt></a>, then
adding the viewport to the scrolled window. If a child has native scrolling
(e.g. <a href="class-gtktextview.html" title="gtk.TextView"><tt class="classname">gtk.TextView</tt></a>,
<a href="class-gtktreeview.html" title="gtk.TreeView"><tt class="classname">gtk.TreeView</tt></a>,
<a href="class-gtklayout.html" title="gtk.Layout"><tt class="classname">gtk.Layout</tt></a>),
use <a href="class-gtkcontainer.html#method-gtkcontainer--add" title="gtk.Container.add"><tt class="methodname">gtk.Container.add</tt>()</a> 
instead of this method.</p><p>The viewport scrolls the child by moving its <a href="class-gdkwindow.html" title="gtk.gdk.Window"><tt class="classname">gtk.gdk.Window</tt></a>,
and takes the size of the child to be the size of its toplevel <a href="class-gdkwindow.html" title="gtk.gdk.Window"><tt class="classname">gtk.gdk.Window</tt></a>.
This will be wrong for most widgets that support native scrolling. For
example, if you add a widget such as <a href="class-gtktreeview.html" title="gtk.TreeView"><tt class="classname">gtk.TreeView</tt></a> with
a viewport, the whole widget will scroll, including the column
headings.</p></div></div><div class="refsect1" lang="en"><a name="id3498394"></a><h2>Signals</h2><div class="refsect2" lang="en"><a name="signal-gtkscrolledwindow--move-focus-out"></a><h3>The "move-focus-out" gtk.ScrolledWindow 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>scrolledwindow</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>direction</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>scrolledwindow</tt></i>:</span></td><td>the scrolledwindow that received the
signal</td></tr><tr><td><span class="term"><i class="parameter"><tt>direction</tt></i>:</span></td><td>the direction that the focus is moving either
<tt class="literal">gtk.DIR_TAB_FORWARD</tt> or
<tt class="literal">gtk.DIR_TAB_BACKWARD</tt>.</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 "move-focus-out" signal is emitted when the user presses
<span><b class="keycap">Control</b></span>+<span><b class="keycap">Tab</b></span> or <span><b class="keycap">Control</b></span>+<span><b class="keycap">Shift</b></span>+<span><b class="keycap">Tab</b></span> to move the focus out of the scrolled window. The
<i class="parameter"><tt>direction</tt></i> is either
<tt class="literal">gtk.DIR_TAB_FORWARD</tt> or
<tt class="literal">gtk.DIR_TAB_BACKWARD</tt></p></div><div class="refsect2" lang="en"><a name="signal-gtkscrolledwindow--scroll-child"></a><h3>The "scroll-child" gtk.ScrolledWindow 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>scrolledwindow</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>scrolltype</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>horizontal</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>scrolledwindow</tt></i>:</span></td><td>the scrolledwindow that received the
signal</td></tr><tr><td><span class="term"><i class="parameter"><tt>scrolltype</tt></i>:</span></td><td>the scroll type; one of:
<tt class="literal">gtk.SCROLL_STEP_BACKWARD</tt>,
<tt class="literal">gtk.SCROLL_STEP_FORWARD</tt>,
<tt class="literal">gtk.SCROLL_PAGE_BACKWARD</tt>,
<tt class="literal">gtk.SCROLL_PAGE_FORWARD</tt>,
<tt class="literal">gtk.SCROLL_PAGE_UP</tt>,
<tt class="literal">gtk.SCROLL_PAGE_DOWN</tt>, <tt class="literal">gtk.SCROLL_START</tt>
or <tt class="literal">gtk.SCROLL_END</tt>.</td></tr><tr><td><span class="term"><i class="parameter"><tt>horizontal</tt></i>:</span></td><td>if TRUE scroll in the horizontal
direction</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 "scroll-child" signal is emitted when the child widget is
being scrolled by a keyboard action. The default key bindings with resulting
<i class="parameter"><tt>scrolltype</tt></i> and <i class="parameter"><tt>horizontal</tt></i>
arguments are:</p><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span><b class="keycap">Control</b></span>+<span><b class="keycap">LeftArrow</b></span></span></td><td><tt class="literal">gtk.SCROLL_STEP_BACKWARD</tt> -
horizontal</td></tr><tr><td><span class="term"><span><b class="keycap">Control</b></span>+<span><b class="keycap">RightArrow</b></span></span></td><td><tt class="literal">gtk.SCROLL_STEP_FORWARD</tt> -
horizontal</td></tr><tr><td><span class="term"><span><b class="keycap">Control</b></span>+<span><b class="keycap">UpArrow</b></span></span></td><td><tt class="literal">gtk.SCROLL_STEP_BACKWARD</tt> -
vertical</td></tr><tr><td><span class="term"><span><b class="keycap">Control</b></span>+<span><b class="keycap">DownArrow</b></span></span></td><td><tt class="literal">gtk.SCROLL_STEP_FORWARD</tt> -
vertical</td></tr><tr><td><span class="term"><span><b class="keycap">Control</b></span>+<span><b class="keycap">PageUp</b></span></span></td><td><tt class="literal">gtk.SCROLL_PAGE_BACKWARD</tt> -
horizontal</td></tr><tr><td><span class="term"><span><b class="keycap">Control</b></span>+<span><b class="keycap">PageDown</b></span></span></td><td><tt class="literal">gtk.SCROLL_PAGE_FORWARD</tt> -
horizontal</td></tr><tr><td><span class="term"><span><b class="keycap">PageUp</b></span></span></td><td><tt class="literal">gtk.SCROLL_PAGE_BACKWARD</tt> -
vertical</td></tr><tr><td><span class="term"><span><b class="keycap">PageDown</b></span></span></td><td><tt class="literal">gtk.SCROLL_PAGE_FORWARD</tt> -
vertical</td></tr><tr><td><span class="term"><span><b class="keycap">Control</b></span>+<span><b class="keycap">Home</b></span></span></td><td><tt class="literal">gtk.SCROLL_START</tt> -
horizontal</td></tr><tr><td><span class="term"><span><b class="keycap">Control</b></span>+<span><b class="keycap">End</b></span></span></td><td><tt class="literal">gtk.SCROLL_END</tt> -
horizontal</td></tr><tr><td><span class="term"><span><b class="keycap">Home</b></span></span></td><td><tt class="literal">gtk.SCROLL_START</tt> -
vertical</td></tr><tr><td><span class="term"><span><b class="keycap">End</b></span></span></td><td><tt class="literal">gtk.SCROLL_END</tt> - vertical</td></tr></tbody></table><p></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-gtkscrollbar.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-gtkselectiondata.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gtk.Scrollbar</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">gtk.SelectionData</td></tr></table></div></body></html>