1
<!-- ##### SECTION Title ##### -->
4
<!-- ##### SECTION Short_Description ##### -->
5
Adds scrollbars to its child widget
7
<!-- ##### SECTION Long_Description ##### -->
9
#GtkScrolledWindow is a #GtkBin subclass: it's a container
10
the accepts a single child widget. #GtkScrolledWindow adds scrollbars
11
to the child widget and optionally draws a beveled frame around the
16
The scrolled window can work in two ways. Some widgets have native
17
scrolling support; these widgets have "slots" for #GtkAdjustment
19
<footnote><para>The scrolled window installs #GtkAdjustment objects in
20
the child window's slots using the set_scroll_adjustments_signal,
21
found in #GtkWidgetClass. (Conceptually, these widgets implement a
22
"Scrollable" interface; because GTK+ 1.2 lacked interface support in
23
the object system, this interface is hackily implemented as a signal
24
in #GtkWidgetClass. The GTK+ 2.0 object system would allow a clean
25
implementation, but it wasn't worth breaking the
26
API.)</para></footnote>
27
Widgets with native scroll support include #GtkTreeView, #GtkTextView,
32
For widgets that lack native scrolling support, the #GtkViewport
33
widget acts as an adaptor class, implementing scrollability for child
34
widgets that lack their own scrolling capabilities. Use #GtkViewport
35
to scroll child widgets such as #GtkTable, #GtkBox, and so on.
39
If a widget has native scrolling abilities, it can be added to the
40
#GtkScrolledWindow with gtk_container_add(). If a widget does not, you
41
must first add the widget to a #GtkViewport, then add the #GtkViewport
42
to the scrolled window. The convenience function
43
gtk_scrolled_window_add_with_viewport() does exactly this, so you can
44
ignore the presence of the viewport.
48
The position of the scrollbars is controlled by the scroll
49
adjustments. See #GtkAdjustment for the fields in an adjustment - for
50
#GtkScrollbar, used by #GtkScrolledWindow, the "value" field
51
represents the position of the scrollbar, which must be between the
52
"lower" field and "upper - page_size." The "page_size" field
53
represents the size of the visible scrollable area. The
54
"step_increment" and "page_increment" fields are used when the user
55
asks to step down (using the small stepper arrows) or page down (using
56
for example the PageDown key).
60
If a #GtkScrolledWindow doesn't behave quite as you would like, or
61
doesn't have exactly the right layout, it's very possible to set up
62
your own scrolling with #GtkScrollbar and for example a #GtkTable.
65
<!-- ##### SECTION See_Also ##### -->
67
#GtkViewport, #GtkAdjustment, #GtkWidgetClass
70
<!-- ##### SECTION Stability_Level ##### -->
73
<!-- ##### SECTION Image ##### -->
76
<!-- ##### STRUCT GtkScrolledWindow ##### -->
78
There are no public fields in the #GtkScrolledWindow struct; it should
79
only be accessed using the functions below.
83
<!-- ##### SIGNAL GtkScrolledWindow::move-focus-out ##### -->
91
<!-- ##### SIGNAL GtkScrolledWindow::scroll-child ##### -->
101
<!-- ##### ARG GtkScrolledWindow:hadjustment ##### -->
106
<!-- ##### ARG GtkScrolledWindow:hscrollbar-policy ##### -->
111
<!-- ##### ARG GtkScrolledWindow:shadow-type ##### -->
116
<!-- ##### ARG GtkScrolledWindow:vadjustment ##### -->
121
<!-- ##### ARG GtkScrolledWindow:vscrollbar-policy ##### -->
126
<!-- ##### ARG GtkScrolledWindow:window-placement ##### -->
131
<!-- ##### ARG GtkScrolledWindow:window-placement-set ##### -->
136
<!-- ##### ARG GtkScrolledWindow:scrollbar-spacing ##### -->
141
<!-- ##### ARG GtkScrolledWindow:scrollbars-within-bevel ##### -->
146
<!-- ##### FUNCTION gtk_scrolled_window_new ##### -->
156
<!-- ##### FUNCTION gtk_scrolled_window_get_hadjustment ##### -->
165
<!-- ##### FUNCTION gtk_scrolled_window_get_vadjustment ##### -->
174
<!-- ##### FUNCTION gtk_scrolled_window_get_hscrollbar ##### -->
183
<!-- ##### FUNCTION gtk_scrolled_window_get_vscrollbar ##### -->
192
<!-- ##### FUNCTION gtk_scrolled_window_set_policy ##### -->
202
<!-- ##### FUNCTION gtk_scrolled_window_add_with_viewport ##### -->
211
<!-- ##### FUNCTION gtk_scrolled_window_set_placement ##### -->
220
<!-- ##### FUNCTION gtk_scrolled_window_unset_placement ##### -->
228
<!-- ##### FUNCTION gtk_scrolled_window_set_shadow_type ##### -->
237
<!-- ##### FUNCTION gtk_scrolled_window_set_hadjustment ##### -->
246
<!-- ##### FUNCTION gtk_scrolled_window_set_vadjustment ##### -->
255
<!-- ##### FUNCTION gtk_scrolled_window_get_placement ##### -->
264
<!-- ##### FUNCTION gtk_scrolled_window_get_policy ##### -->
274
<!-- ##### FUNCTION gtk_scrolled_window_get_shadow_type ##### -->