summaryrefslogtreecommitdiff
path: root/docs/reference/pygtk-gtkscrolledwindow.xml
blob: bc99f46a4f54687605a05910ce930c30a2023f49 (plain)
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
<?xml version="1.0" standalone="no"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
    "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">

<refentry id="class-gtkscrolledwindow">
  <refnamediv>
    <refname>gtk.ScrolledWindow</refname>
    <refpurpose>adds scrollbars to its child widget.</refpurpose>
  </refnamediv>

  <refsect1>
    <title>Synopsis</title>

    <classsynopsis language="python">
      <ooclass><classname>gtk.ScrolledWindow</classname></ooclass>
      <ooclass><classname><link
linkend="class-gtkbin">gtk.Bin</link></classname></ooclass>
      <constructorsynopsis language="python">
	<methodname><link linkend="constructor-gtkscrolledwindow">gtk.ScrolledWindow</link></methodname>
	<methodparam><parameter
		       role="keyword">hadjustment</parameter><initializer>None</initializer></methodparam>
	<methodparam><parameter
		       role="keyword">vadjustment</parameter><initializer>None</initializer></methodparam>
      </constructorsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtkscrolledwindow--set-hadjustment">set_hadjustment</link></methodname>
	<methodparam><parameter
		       role="keyword">hadjustment</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtkscrolledwindow--set-vadjustment">set_vadjustment</link></methodname>
	<methodparam><parameter
		       role="keyword">vadjustment</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtkscrolledwindow--get-hadjustment">get_hadjustment</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtkscrolledwindow--get-vadjustment">get_vadjustment</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtkscrolledwindow--get-hscrollbar">get_hscrollbar</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtkscrolledwindow--get-vscrollbar">get_vscrollbar</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtkscrolledwindow--set-policy">set_policy</link></methodname>
	<methodparam><parameter
		       role="keyword">hscrollbar_policy</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">vscrollbar_policy</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtkscrolledwindow--get-policy">get_policy</link></methodname>
	<methodparam><parameter
		       role="keyword">hscrollbar_policy</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">vscrollbar_policy</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtkscrolledwindow--set-placement">set_placement</link></methodname>
	<methodparam><parameter
		       role="keyword">window_placement</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtkscrolledwindow--get-placement">get_placement</link></methodname>
	<methodparam></methodparam>  </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtkscrolledwindow--set-shadow-type">set_shadow_type</link></methodname>
	<methodparam><parameter
		       role="keyword">type</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtkscrolledwindow--get-shadow-type">get_shadow_type</link></methodname>
	<methodparam></methodparam>  </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtkscrolledwindow--add-with-viewport">add_with_viewport</link></methodname>
	<methodparam><parameter
		       role="keyword">child</parameter></methodparam>
      </methodsynopsis>
    </classsynopsis>

  </refsect1>

  <refsect1>
    <title>Ancestry</title>

<synopsis>+-- <link linkend="class-gobject">gobject.GObject</link>
  +-- <link linkend="class-gtkobject">gtk.Object</link>
    +-- <link linkend="class-gtkwidget">gtk.Widget</link>
      +-- <link linkend="class-gtkcontainer">gtk.Container</link>
        +-- <link linkend="class-gtkbin">gtk.Bin</link>
          +-- <link linkend="class-gtkscrolledwindow">gtk.ScrolledWindow</link>
</synopsis>

  </refsect1>
  
  <refsect1>
		<title>Implemented Interfaces</title>
		<para>
			<link linkend="class-gtkscrolledwindow"><classname>gtk.ScrolledWindow</classname></link>
			implements 
			<link linkend="class-gtkbuildable"><classname>gtk.Buildable</classname></link>
		</para>
	</refsect1>


  <refsect1 id="properties-gtkscrolledwindow">
    <title>gtk.ScrolledWindow Properties</title>

    <para><link linkend="properties-gtkobject">gtk.Object Properties</link></para>
    <para><link linkend="properties-gtkwidget">gtk.Widget Properties</link></para>
    <para><link linkend="properties-gtkcontainer">gtk.Container Properties</link></para>

    <blockquote role="properties">
      <informaltable pgwide="1" frame="none">
	<tgroup cols="3">
	  <colspec column="1" colwidth="1in"/>
	  <colspec column="2" colwidth="1in"/>
	  <colspec column="3" colwidth="4in"/>
	  <tbody>

	    <row valign="top">
	      <entry>"hadjustment"</entry>
	      <entry>Read-Write-Construct</entry>
	      <entry>The <link
linkend="class-gtkadjustment"><classname>gtk.Adjustment</classname></link>
for the horizontal position.</entry>
	    </row>

	    <row valign="top">
	      <entry>hscrollbar-policy""</entry>
	      <entry>Read-Write</entry>
	      <entry>The horizontal scrollbar display policy; one of:
<literal>gtk.POLICY_ALWAYS</literal>,
<literal>gtk.POLICY_AUTOMATIC</literal> or
<literal>gtk.POLICY_NEVER</literal>.</entry>
	    </row>

	    <row valign="top">
	      <entry>"shadow-type"</entry>
	      <entry>Read-Write</entry>
	      <entry>The style of bevel around the contents; one of:
<literal>gtk.SHADOW_NONE</literal>, <literal>gtk.SHADOW_IN</literal>,
<literal>gtk.SHADOW_OUT</literal>, <literal>gtk.SHADOW_ETCHED_IN</literal>,
<literal>gtk.SHADOW_ETCHED_OUT</literal>.</entry>
	    </row>

	    <row valign="top">
	      <entry>"vadjustment"</entry>
	      <entry>Read-Write-Construct</entry>
	      <entry>The <link
linkend="class-gtkadjustment"><classname>gtk.Adjustment</classname></link>
for the vertical position.</entry>
	    </row>

	    <row valign="top">
	      <entry>"vscrollbar-policy"</entry>
	      <entry>Read-Write</entry>
	      <entry>The vertical scrollbar display policy; one of:
<literal>gtk.POLICY_ALWAYS</literal>,
<literal>gtk.POLICY_AUTOMATIC</literal> or
<literal>gtk.POLICY_NEVER</literal>.</entry>
	    </row>

	    <row valign="top">
	      <entry>"window-placement"</entry>
	      <entry>Read-Write</entry>
	      <entry>Where the contents are located with respect to the
scrollbars; one of: <literal>gtk.CORNER_TOP_LEFT</literal>,
<literal>gtk.CORNER_BOTTOM_LEFT</literal>,
<literal>gtk.CORNER_TOP_RIGHT</literal>,
<literal>gtk.CORNER_BOTTOM_RIGHT</literal>.</entry>
	    </row>

        <row valign="top">
          <entry>"window-placement-set"</entry>
          <entry>Read-Write</entry>
          <entry>If <literal>True</literal> "window-placement" should be
          used to determine the location of the contents with respect to the
          scrollbars.</entry>
        </row>

	  </tbody>
	</tgroup>
      </informaltable>
    </blockquote>

  </refsect1>

  <refsect1 id="style-properties-gtkscrolledwindow">
    <title>gtk.ScrolledWindow Style Properties</title>

    <para><link linkend="style-properties-gtkwidget">gtk.Widget Style Properties</link></para>

    <blockquote role="properties">
      <informaltable pgwide="1" frame="none">
	<tgroup cols="3">
	  <colspec column="1" colwidth="1in"/>
	  <colspec column="2" colwidth="1in"/>
	  <colspec column="3" colwidth="4in"/>
	  <tbody>

	    <row valign="top">
	      <entry>"scrollbar-spacing"</entry>
	      <entry>Read</entry>

	      <entry>The number of pixels between the scrollbars and the
	      scrolled window. Available in <literal>GTK+</literal> 2.2 and
	      above.</entry>
	    </row>
        
        <row valign="top">
	      <entry>"scrollbar-within-bevel"</entry>
	      <entry>Read</entry>

	      <entry>Whether to place scrollbars within the scrolled window's bevel.
          Default value: <literal>False</literal>
          Available in <literal>GTK+</literal> 2.12 and
	      above.</entry>
	    </row>

	  </tbody>
	</tgroup>
      </informaltable>
    </blockquote>

  </refsect1>

  <refsect1 id="signal-prototypes-gtkscrolledwindow">
    <title>gtk.ScrolledWindow Signal Prototypes</title>

    <para><link linkend="signal-prototypes-gobject">gobject.GObject Signal Prototypes</link></para>
    <para><link linkend="signal-prototypes-gtkobject">gtk.Object Signal Prototypes</link></para>
    <para><link linkend="signal-prototypes-gtkwidget">gtk.Widget Signal Prototypes</link></para>
    <para><link linkend="signal-prototypes-gtkcontainer">gtk.Container Signal Prototypes</link></para>

    <variablelist>
      <varlistentry>
        <term>"<link linkend="signal-gtkscrolledwindow--move-focus-out">move-focus-out</link>"</term>
        <listitem>
          <methodsynopsis language="python"><methodname>callback</methodname>
            <methodparam><parameter>scrolledwindow</parameter></methodparam>
            <methodparam><parameter>direction</parameter></methodparam>
            <methodparam><parameter>user_param1</parameter></methodparam>
            <methodparam><parameter>...</parameter></methodparam>
          </methodsynopsis>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>"<link linkend="signal-gtkscrolledwindow--scroll-child">scroll-child</link>"</term>
        <listitem>
          <methodsynopsis language="python"><methodname>callback</methodname>
            <methodparam><parameter>scrolledwindow</parameter></methodparam>
            <methodparam><parameter>scrolltype</parameter></methodparam>
            <methodparam><parameter>horizontal</parameter></methodparam>
            <methodparam><parameter>user_param1</parameter></methodparam>
            <methodparam><parameter>...</parameter></methodparam>
          </methodsynopsis>
        </listitem>
      </varlistentry>
    </variablelist>

  </refsect1>

  <refsect1>
    <title>Description</title>

    <para>A <link
linkend="class-gtkscrolledwindow"><classname>gtk.ScrolledWindow</classname></link> 
is a subclass of <link
linkend="class-gtkbin"><classname>gtk.Bin</classname></link> 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:</para>

    <itemizedlist>
      <listitem>
	<simpara>Some widgets have native scrolling support using "slots" to
hold <link
linkend="class-gtkadjustment"><classname>gtk.Adjustment</classname></link>
objects. Widgets with native scroll support include <link
linkend="class-gtktreeview"><classname>gtk.TreeView</classname></link>,
<link
linkend="class-gtktextview"><classname>gtk.TextView</classname></link>, and
<link
linkend="class-gtklayout"><classname>gtk.Layout</classname></link>.</simpara>
      </listitem>
      <listitem>
	<simpara>Widgets that lack native scrolling support use the <link
linkend="class-gtkviewport"><classname>gtk.Viewport</classname></link>
widget that acts as an adapter class, implementing scrollability for child
widgets that lack their own scrolling capabilities. Use <link
linkend="class-gtkviewport"><classname>gtk.Viewport</classname></link> to
scroll child widgets such as <link
linkend="class-gtktable"><classname>gtk.Table</classname></link>, <link
linkend="class-gtkbox"><classname>gtk.Box</classname></link>, and so
on.</simpara>
      </listitem>
    </itemizedlist>

    <para>If a widget has native scrolling abilities, it can be added to the
<link
linkend="class-gtkscrolledwindow"><classname>gtk.ScrolledWindow</classname></link> 
with the <link
linkend="method-gtkcontainer--add"><methodname>gtk.Container.add</methodname>()</link> 
method. If a widget does not, you must first add the widget to a <link
linkend="class-gtkviewport"><classname>gtk.Viewport</classname></link>, then
add the <link
linkend="class-gtkviewport"><classname>gtk.Viewport</classname></link> to
the scrolled window. The convenience method <link
linkend="method-gtkscrolledwindow--add-with-viewport"><methodname>add_with_viewport</methodname>()</link> 
does exactly this, so you can ignore the presence of the viewport.</para>

    <para>The position of the scrollbars is controlled by the scroll
adjustments. The <link
linkend="class-gtkscrolledwindow"><classname>gtk.ScrolledWindow</classname></link> 
uses the attributes in an adjustment (see <link
linkend="class-gtkadjustment"><classname>gtk.Adjustment</classname></link>)
as follows:</para>

    <itemizedlist>
      <listitem>
	<simpara>the <literal>adjustment.lower</literal> attribute is the
minimum value of the scroll region</simpara>
      </listitem>
      <listitem>
	<simpara>the <literal>adjustment.upper</literal> attribute is the
maximum value of the scroll region</simpara>
      </listitem>
      <listitem>
	<simpara>the <literal>adjustment.value</literal> attribute
represents the position of the scrollbar, which must be between
<literal>adjustment.lower</literal> and <literal>adjustment.upper</literal>
- <literal>adjustment.page_size</literal></simpara>
      </listitem>
      <listitem>
	<simpara>the <literal>adjustment.page_size</literal> attribute
represents the size of the visible scrollable area</simpara>
      </listitem>
      <listitem>
	<simpara>the <literal>adjustment.step_increment</literal> attribute
is the distance to scroll when the small stepper arrows are
clicked</simpara>
      </listitem>
      <listitem>
	<simpara>the <literal>adjustment.page_increment</literal> attribute
is the distance to scroll when the <keycap>Page Up</keycap> or <keycap>Page
Down</keycap> keys are pressed</simpara>
      </listitem>
    </itemizedlist>

    <para>If a <link
linkend="class-gtkscrolledwindow"><classname>gtk.ScrolledWindow</classname></link> 
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 <link
linkend="class-gtkscrollbar"><classname>gtk.Scrollbar</classname></link> and
for example a <link
linkend="class-gtktable"><classname>gtk.Table</classname></link>.</para>

  </refsect1>

  <refsect1 id="constructor-gtkscrolledwindow">
    <title>Constructor</title>

    <programlisting><constructorsynopsis language="python">
	<methodname>gtk.ScrolledWindow</methodname>
	<methodparam><parameter role="keyword">hadjustment</parameter>
	  <initializer>None</initializer></methodparam>
	<methodparam><parameter role="keyword">vadjustment</parameter>
	  <initializer>None</initializer></methodparam>
      </constructorsynopsis></programlisting>
    <variablelist>
      <varlistentry>
	<term><parameter
role="keyword">hadjustment</parameter>&nbsp;:</term>
	<listitem><simpara>the horizontal <link
linkend="class-gtkadjustment"><classname>gtk.Adjustment</classname></link>
or None</simpara></listitem>
      </varlistentry>
      <varlistentry>
	<term><parameter
role="keyword">vadjustment</parameter>&nbsp;:</term> <listitem><simpara>a
vertical <link
linkend="class-gtkadjustment"><classname>gtk.Adjustment</classname></link>
or None</simpara></listitem>
      </varlistentry>
      <varlistentry>
	<term><emphasis>Returns</emphasis>&nbsp;:</term>
	<listitem><simpara>a new <link
linkend="class-gtkscrolledwindow"><classname>gtk.ScrolledWindow</classname></link> 
widget</simpara></listitem>
      </varlistentry>
    </variablelist>

    <para>Creates a new scrolled window with the horizontal and vertical
<link
linkend="class-gtkadjustment"><classname>gtk.Adjustment</classname></link>
specified by <parameter>hadjustment</parameter> and
<parameter>vadjustment</parameter> respectively. These will be shared with
the scrollbars and the child widget to keep the bars in sync with the child.
If <parameter>hadjustment</parameter> and <parameter>vadjustment</parameter>
are <literal>None</literal> or not specified the scrolled window will create
them for you.</para>

  </refsect1>

  <refsect1>
    <title>Methods</title>

    <refsect2 id="method-gtkscrolledwindow--set-hadjustment">
      <title>gtk.ScrolledWindow.set_hadjustment</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_hadjustment</methodname>
	  <methodparam><parameter
			 role="keyword">hadjustment</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter
role="keyword">hadjustment</parameter>&nbsp;:</term>
	  <listitem><simpara>the horizontal <link
linkend="class-gtkadjustment"><classname>gtk.Adjustment</classname></link></simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>set_hadjustment</methodname>() method sets the
horizontal adjustment (and the "hadjustment" property) to the value of
<parameter>hadjustment</parameter>. <parameter>hadjustment</parameter> must
be a <link
linkend="class-gtkadjustment"><classname>gtk.Adjustment</classname></link>.</para>

    </refsect2>

    <refsect2 id="method-gtkscrolledwindow--set-vadjustment">
      <title>gtk.ScrolledWindow.set_vadjustment</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_vadjustment</methodname>
	  <methodparam><parameter
			 role="keyword">vadjustment</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter
role="keyword">vadjustment</parameter>&nbsp;:</term>
	  <listitem><simpara>the vertical <link
linkend="class-gtkadjustment"><classname>gtk.Adjustment</classname></link></simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>set_vadjustment</methodname>() method sets the
vertical adjustment (and the "vadjustment" property) to the value of
<parameter>vadjustment</parameter>. <parameter>vadjustment</parameter> must
be a <link
linkend="class-gtkadjustment"><classname>gtk.Adjustment</classname></link>.</para>

    </refsect2>

    <refsect2 id="method-gtkscrolledwindow--get-hadjustment">
      <title>gtk.ScrolledWindow.get_hadjustment</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_hadjustment</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the horizontal <link
linkend="class-gtkadjustment"><classname>gtk.Adjustment</classname></link></simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>get_hadjustment</methodname>() method returns
the value of the "hadjustment" property which is a reference to the
horizontal adjustment.</para>

    </refsect2>

    <refsect2 id="method-gtkscrolledwindow--get-vadjustment">
      <title>gtk.ScrolledWindow.get_vadjustment</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_vadjustment</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the vertical <link
linkend="class-gtkadjustment"><classname>gtk.Adjustment</classname></link></simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>get_vadjustment</methodname>() method returns
the value of the "vadjustment" property which is a reference to the vertical
adjustment.</para>

    </refsect2>

    <refsect2 id="method-gtkscrolledwindow--get-hscrollbar">
      <title>gtk.ScrolledWindow.get_hscrollbar</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_hscrollbar</methodname>
	  <methodparam></methodparam>
        </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>The horizontal scrollbar of the scrolled window
or <literal>None</literal> if it does not exist.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
        <para>This method is available in PyGTK 2.8 and above.</para>
      </note>

      <para>The <methodname>get_hscrollbar</methodname>() method returns the
<link
linkend="class-gtkhscrollbar"><classname>gtk.HScrollbar</classname></link>
for the scrolled window or <literal>None</literal> if there is no horizontal
scrollbar.</para>

    </refsect2>

    <refsect2 id="method-gtkscrolledwindow--get-vscrollbar">
      <title>gtk.ScrolledWindow.get_vscrollbar</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_vscrollbar</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>The vertical scrollbar of the scrolled window
or <literal>None</literal> if it does not exist.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
        <para>This method is available in PyGTK 2.8 and above.</para>
      </note>

      <para>The <methodname>get_vscrollbar</methodname>() method returns the
<link
linkend="class-gtkvscrollbar"><classname>gtk.VScrollbar</classname></link>
for the scrolled window or <literal>None</literal> if there is no vertical
scrollbar.</para>

    </refsect2>

    <refsect2 id="method-gtkscrolledwindow--set-policy">
      <title>gtk.ScrolledWindow.set_policy</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_policy</methodname>
	  <methodparam><parameter
			 role="keyword">hscrollbar_policy</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">vscrollbar_policy</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter
role="keyword">hscrollbar_policy</parameter>&nbsp;:</term>
	  <listitem><simpara>the policy for the horizontal
scrollbar</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">vscrollbar_policy</parameter>&nbsp;:</term>
	  <listitem><simpara>the policy for the vertical
scrollbar</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>set_policy</methodname>() method sets the
"hscrollbar_policy" and "vscrollbar_policy" properties to the value of
<parameter>hscrollbar_policy</parameter> and
<parameter>vscrollbar_policy</parameter> respectively. The policy determines
when the scrollbar should be displayed. The policy value is one of:</para>

      <variablelist>
	<varlistentry>
	  <term>gtk.POLICY_ALWAYS</term>
	  <listitem>
	    <simpara>the scrollbar is always present</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term>gtk.POLICY_AUTOMATIC</term>
	  <listitem>
	    <simpara>the scrollbar is present only if needed i.e. the
contents are larget than the window</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term>gtk.POLICY_NEVER</term>
	  <listitem>
	    <simpara>the scrollbar is never present</simpara>
	  </listitem>
	</varlistentry>
      </variablelist>

      <para></para>

    </refsect2>

    <refsect2 id="method-gtkscrolledwindow--get-policy">
      <title>gtk.ScrolledWindow.get_policy</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_policy</methodname>
	  <methodparam></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>>&nbsp;:</term>
	  <listitem><simpara>a tuple containing the horizontal and vertical
scrollbar policies</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>get_policy</methodname>() method returns a tuple
containing the horizontal and vertical scrollbar policies. See the <link
linkend="method-gtkscrolledwindow--set-policy"><methodname>set_policy</methodname>()</link> method for more detail.</para>

    </refsect2>

    <refsect2 id="method-gtkscrolledwindow--set-placement">
      <title>gtk.ScrolledWindow.set_placement</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_placement</methodname>
	  <methodparam><parameter
			 role="keyword">window_placement</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter
role="keyword">window_placement</parameter>&nbsp;:</term>
	  <listitem><simpara>the placement of the contents with respect to
the scrollbars</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>set_placement</methodname>() method sets the
"window-placement" property to the value specified by
<parameter>window_placement</parameter>. The window placement determines the
location of the child widget with respect to the scrollbars.
<parameter>window_placement</parameter> must be one of:</para>

      <variablelist>
	<varlistentry>
	  <term>gtk.CORNER_TOP_LEFT</term>
	  <listitem>
	    <simpara>Place the scrollbars on the right and bottom of the
widget (default behavior).</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term>gtk.CORNER_BOTTOM_LEFT</term>
	  <listitem>
	    <simpara>Place the scrollbars on the top and right of the
widget.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term>gtk.CORNER_TOP_RIGHT</term>
	  <listitem>
	    <simpara>Place the scrollbars on the left and bottom of the
widget.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term>gtk.CORNER_BOTTOM_RIGHT</term>
	  <listitem>
	    <simpara>Place the scrollbars on the top and left of the
widget.</simpara>
	  </listitem>
	</varlistentry>
      </variablelist>

      <para></para>

    </refsect2>

    <refsect2 id="method-gtkscrolledwindow--get-placement">
      <title>gtk.ScrolledWindow.get_placement</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_placement</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the current placement
value.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>get_placement</methodname>() method returns the
value of the "window-placement" property that determines the placement of
the scrollbars with respect to the scrolled window. See the <link
linkend="method-gtkscrolledwindow--set-placement"><methodname>set_placement</methodname>()</link> 
method for more detail.</para>

    </refsect2>

    <refsect2 id="method-gtkscrolledwindow--set-shadow-type">
      <title>gtk.ScrolledWindow.set_shadow_type</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_shadow_type</methodname>
	  <methodparam><parameter
			 role="keyword">type</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">type</parameter>&nbsp;:</term>
	  <listitem><simpara>the kind of bevel shadow to draw around the
scrolled window contents</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>set_shadow_type</methodname>() method sets the
value of the "shadow-type" property to the value of
<parameter>shadow_type</parameter>. <parameter>shadow_type</parameter>
determines the type of bevel shadow drawn around the contents of the
scrolled window. The shadow type must be one of:</para>

      <variablelist>
	<varlistentry>
	  <term>gtk.SHADOW_NONE</term>
	  <listitem>
	    <simpara>No outline.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term>gtk.SHADOW_IN</term>
	  <listitem>
	    <simpara>The outline is beveled inward.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term>gtk.SHADOW_OUT</term>
	  <listitem>
	    <simpara>The outline is beveled outward.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term>gtk.SHADOW_ETCHED_IN</term>
	  <listitem>
	    <simpara>The outline is an inward etched bevel.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term>gtk.SHADOW_ETCHED_OUT</term>
	  <listitem>
	    <simpara>The outline is an outward etched bevel.</simpara>
	  </listitem>
	</varlistentry>
      </variablelist>

      <para></para>

    </refsect2>

    <refsect2 id="method-gtkscrolledwindow--get-shadow-type">
      <title>gtk.ScrolledWindow.get_shadow_type</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_shadow_type</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the current shadow type</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>get_shadow_type</methodname>() method returns
the value of the "shadow-type" property that determines the shadow type of
the scrolled window. See the <link
linkend="method-gtkscrolledwindow--set-shadow-type"><methodname>set_shadow_type</methodname>()</link> 
method for more detail.</para>

    </refsect2>

    <refsect2 id="method-gtkscrolledwindow--add-with-viewport">
      <title>gtk.ScrolledWindow.add_with_viewport</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>add_with_viewport</methodname>
	  <methodparam><parameter
			 role="keyword">child</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">child</parameter>&nbsp;:</term>
	  <listitem><simpara>the widget to be scrolled</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>add_with_viewport</methodname>() method is used
to add a widget (specified by <parameter>child</parameter>) without native
scrolling capabilities to the scrolled window. This is a convenience
function that is equivalent to adding <parameter>child</parameter> to a
<link
linkend="class-gtkviewport"><classname>gtk.Viewport</classname></link>, then
adding the viewport to the scrolled window. If a child has native scrolling
(e.g. <link
linkend="class-gtktextview"><classname>gtk.TextView</classname></link>,
<link
linkend="class-gtktreeview"><classname>gtk.TreeView</classname></link>,
<link linkend="class-gtklayout"><classname>gtk.Layout</classname></link>),
use <link
linkend="method-gtkcontainer--add"><methodname>gtk.Container.add</methodname>()</link> 
instead of this method.</para>

      <para>The viewport scrolls the child by moving its <link
linkend="class-gdkwindow"><classname>gtk.gdk.Window</classname></link>,
and takes the size of the child to be the size of its toplevel <link
linkend="class-gdkwindow"><classname>gtk.gdk.Window</classname></link>.
This will be wrong for most widgets that support native scrolling. For
example, if you add a widget such as <link
linkend="class-gtktreeview"><classname>gtk.TreeView</classname></link> with
a viewport, the whole widget will scroll, including the column
headings.</para>

    </refsect2>

  </refsect1>

  <refsect1>
    <title>Signals</title>

    <refsect2 id="signal-gtkscrolledwindow--move-focus-out">
      <title>The "move-focus-out" gtk.ScrolledWindow Signal</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>callback</methodname>
	  <methodparam><parameter>scrolledwindow</parameter></methodparam>
	  <methodparam><parameter>direction</parameter></methodparam>
	  <methodparam><parameter>user_param1</parameter></methodparam>
	  <methodparam><parameter>...</parameter></methodparam>
	</methodsynopsis></programlisting>

      <variablelist>
	<varlistentry>
	  <term><parameter>scrolledwindow</parameter>&nbsp;:</term>
	  <listitem><simpara>the scrolledwindow that received the
signal</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>direction</parameter>&nbsp;:</term>
	  <listitem><simpara>the direction that the focus is moving either
<literal>gtk.DIR_TAB_FORWARD</literal> or
<literal>gtk.DIR_TAB_BACKWARD</literal>.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>user_param1</parameter>&nbsp;:</term>
          <listitem><simpara>the first user parameter (if any) specified
with the <link
linkend="method-gobject--connect"><methodname>connect</methodname>()</link>
method</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>...</parameter>&nbsp;:</term>
	  <listitem><simpara>additional user parameters (if
any)</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The "move-focus-out" signal is emitted when the user presses
<keycombo action="simul"><keycap>Control</keycap><keycap>Tab</keycap>
</keycombo> or <keycombo
action="simul"><keycap>Control</keycap><keycap>Shift</keycap><keycap>Tab</keycap>
</keycombo> to move the focus out of the scrolled window. The
<parameter>direction</parameter> is either
<literal>gtk.DIR_TAB_FORWARD</literal> or
<literal>gtk.DIR_TAB_BACKWARD</literal></para>

    </refsect2>

    <refsect2 id="signal-gtkscrolledwindow--scroll-child">
      <title>The "scroll-child" gtk.ScrolledWindow Signal</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>callback</methodname>
	  <methodparam><parameter>scrolledwindow</parameter></methodparam>
	  <methodparam><parameter>scrolltype</parameter></methodparam>
	  <methodparam><parameter>horizontal</parameter></methodparam>
	  <methodparam><parameter>user_param1</parameter></methodparam>
	  <methodparam><parameter>...</parameter></methodparam>
	</methodsynopsis></programlisting>

      <variablelist>
	<varlistentry>
	  <term><parameter>scrolledwindow</parameter>&nbsp;:</term>
	  <listitem><simpara>the scrolledwindow that received the
signal</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>scrolltype</parameter>&nbsp;:</term>
	  <listitem><simpara>the scroll type; one of:
<literal>gtk.SCROLL_STEP_BACKWARD</literal>,
<literal>gtk.SCROLL_STEP_FORWARD</literal>,
<literal>gtk.SCROLL_PAGE_BACKWARD</literal>,
<literal>gtk.SCROLL_PAGE_FORWARD</literal>,
<literal>gtk.SCROLL_PAGE_UP</literal>,
<literal>gtk.SCROLL_PAGE_DOWN</literal>, <literal>gtk.SCROLL_START</literal>
or <literal>gtk.SCROLL_END</literal>.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>horizontal</parameter>&nbsp;:</term>
	  <listitem><simpara>if True scroll in the horizontal
direction</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>user_param1</parameter>&nbsp;:</term>
          <listitem><simpara>the first user parameter (if any) specified
with the <link
linkend="method-gobject--connect"><methodname>connect</methodname>()</link>
method</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>...</parameter>&nbsp;:</term>
	  <listitem><simpara>additional user parameters (if
any)</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The "scroll-child" signal is emitted when the child widget is
being scrolled by a keyboard action. The default key bindings with resulting
<parameter>scrolltype</parameter> and <parameter>horizontal</parameter>
arguments are:</para>

      <variablelist>
	<varlistentry>
	  <term><keycombo action="simul"><keycap>Control</keycap>
	      <keycap>Left&nbsp;Arrow</keycap> 
	    </keycombo></term>
	  <listitem>
	    <simpara><literal>gtk.SCROLL_STEP_BACKWARD</literal> -
horizontal</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><keycombo action="simul"><keycap>Control</keycap>
	      <keycap>Right&nbsp;Arrow</keycap>
	    </keycombo></term>
	  <listitem>
	    <simpara><literal>gtk.SCROLL_STEP_FORWARD</literal> -
horizontal</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><keycombo action="simul"><keycap>Control</keycap>
	      <keycap>Up&nbsp;Arrow</keycap>
	    </keycombo></term>
	  <listitem>
	    <simpara><literal>gtk.SCROLL_STEP_BACKWARD</literal> -
vertical</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><keycombo action="simul"><keycap>Control</keycap>
	      <keycap>Down&nbsp;Arrow</keycap>
	    </keycombo></term>
	  <listitem>
	    <simpara><literal>gtk.SCROLL_STEP_FORWARD</literal> -
vertical</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><keycombo action="simul"><keycap>Control</keycap>
	      <keycap>Page&nbsp;Up</keycap>
	    </keycombo></term>
	  <listitem>
	    <simpara><literal>gtk.SCROLL_PAGE_BACKWARD</literal> -
horizontal</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><keycombo action="simul"><keycap>Control</keycap>
	      <keycap>Page&nbsp;Down</keycap>
	    </keycombo></term>
	  <listitem>
	    <simpara><literal>gtk.SCROLL_PAGE_FORWARD</literal> -
horizontal</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><keycombo action="simul"><keycap>Page&nbsp;Up</keycap>
	    </keycombo></term>
	  <listitem>
	    <simpara><literal>gtk.SCROLL_PAGE_BACKWARD</literal> -
vertical</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><keycombo action="simul"><keycap>Page&nbsp;Down</keycap>
	    </keycombo></term>
	  <listitem>
	    <simpara><literal>gtk.SCROLL_PAGE_FORWARD</literal> -
vertical</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><keycombo action="simul"><keycap>Control</keycap>
	      <keycap>Home</keycap>
	    </keycombo></term>
	  <listitem>
	    <simpara><literal>gtk.SCROLL_START</literal> -
horizontal</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><keycombo action="simul"><keycap>Control</keycap>
	      <keycap>End</keycap>
	    </keycombo></term>
	  <listitem>
	    <simpara><literal>gtk.SCROLL_END</literal> -
horizontal</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><keycombo action="simul"><keycap>Home</keycap>
	    </keycombo></term>
	  <listitem>
	    <simpara><literal>gtk.SCROLL_START</literal> -
vertical</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><keycombo action="simul"><keycap>End</keycap>
	    </keycombo></term>
	  <listitem>
	    <simpara><literal>gtk.SCROLL_END</literal> - vertical</simpara>
	  </listitem>
	</varlistentry>
      </variablelist>

      <para></para>

    </refsect2>

  </refsect1>

</refentry>