It derives from <GtkWidget>.
Makes its child scrollable.
It does so using either internally added scrollbars or externally associated adjustments, and optionally draws a frame around the child.
Widgets with native scrolling support, i.e. those whose classes
implement the <GtkScrollable> interface, are
added directly. For other types of widget, the class
<GtkViewport> acts as an adaptor, giving
scrollability to other widgets. scrolled-window:set-child intelligently accounts for
whether or not the added child is a
<GtkScrollable>. If it isn’t, then it wraps
the child in a <GtkViewport>. Therefore, you can
just add any child widget and not worry about the details.
If scrolled-window:set-child has
added a <GtkViewport> for you, it will be
automatically removed when you unset the child. Unless
scrolled-window:hscrollbar-policy and
scrolled-window:vscrollbar-policy are
never or external,
<GtkScrolledWindow> adds internal
<GtkScrollbar> widgets around its child. The
scroll position of the child, and if applicable the scrollbars, is
controlled by the scrolled-window:hadjustment and scrolled-window:vadjustment that are associated
with the <GtkScrolledWindow>. See the docs
on <GtkScrollbar> for the details, but note that
the “step_increment” and “page_increment” fields are only effective if
the policy causes scrollbars to be present.
If a <GtkScrolledWindow> 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
<GtkScrollbar> and for example a
<GtkGrid>.
<GtkScrolledWindow> has built-in support
for touch devices. When a touchscreen is used, swiping will move the
scrolled window, and will expose ’kinetic’ behavior. This can be turned
off with the scrolled-window:kinetic-scrolling property if it is
undesired.
<GtkScrolledWindow> also displays visual
’overshoot’ indication when the content is pulled beyond the end, and
this situation can be captured with the scrolled-window:edge-overshot signal.
If no mouse device is present, the scrollbars will overlaid as narrow,
auto-hiding indicators over the content. If traditional scrollbars are
desired although no mouse is present, this behaviour can be turned off
with the scrolled-window:overlay-scrolling property.
The following signals have default keybindings:
<GtkScrolledWindow> has a main CSS node
with name scrolledwindow. It gets a .frame style class added when
scrolled-window:has-frame is #t.
It uses subnodes with names overshoot and undershoot to draw the overflow and underflow indications. These nodes get the .left, .right, .top or .bottom style class added depending on where the indication is drawn.
<GtkScrolledWindow> also sets the
positional style classes (.left, .right, .top, .bottom) and style
classes related to overlay scrolling (.overlay-indicator, .dragging,
.hovering) on its scrollbars.
If both scrollbars are visible, the area where they meet is drawn with a subnode named junction.
Until GTK 4.10, <GtkScrolledWindow> used
the Gtk.AccessibleRole.group role.
Starting from GTK 4.12, <GtkScrolledWindow>
uses the Gtk.AccessibleRole.generic role.
The child widget.
When setting this property, if the child widget does not implement
<GtkScrollable>, the scrolled window will add
the child to a <GtkViewport> and then set the
viewport as the child.
Its value is a <GtkWidget>, or #f.
Set it with (set! (scrolled-window:child self) value).
The <GtkAdjustment> for the horizontal
position.
Its value is a <GtkAdjustment>, or #f.
Set it with (set! (scrolled-window:hadjustment self) value).
Whether to draw a frame around the contents.
Its value is a boolean.
Set it with (set! (scrolled-window:has-frame self) value).
When the horizontal scrollbar is displayed.
Use scrolled-window:set-policy
to set this property.
Its value is a <GtkPolicyType> (or, to set it,
one of its symbols).
Set it with (set! (scrolled-window:hscrollbar-policy self)
value).
Whether kinetic scrolling is enabled or not.
Kinetic scrolling only applies to devices with source
touchscreen.
Its value is a boolean.
Set it with (set! (scrolled-window:kinetic-scrolling self)
value).
The maximum content height of scrolled-window.
Its value is a 32-bit integer.
Set it with (set! (scrolled-window:max-content-height self)
value).
The maximum content width of scrolled-window.
Its value is a 32-bit integer.
Set it with (set! (scrolled-window:max-content-width self)
value).
The minimum content height of scrolled-window.
Its value is a 32-bit integer.
Set it with (set! (scrolled-window:min-content-height self)
value).
The minimum content width of scrolled-window.
Its value is a 32-bit integer.
Set it with (set! (scrolled-window:min-content-width self)
value).
Whether overlay scrolling is enabled or not.
If it is, the scrollbars are only added as traditional widgets when a mouse is present. Otherwise, they are overlaid on top of the content, as narrow indicators.
Note that overlay scrolling can also be globally disabled, with the
settings:gtk-overlay-scrolling setting.
Its value is a boolean.
Set it with (set! (scrolled-window:overlay-scrolling self)
value).
Whether the natural height of the child should be calculated and propagated through the scrolled window’s requested natural height.
This is useful in cases where an attempt should be made to allocate exactly enough space for the natural size of the child.
Its value is a boolean.
Set it with (set! (scrolled-window:propagate-natural-height self)
value).
Whether the natural width of the child should be calculated and propagated through the scrolled window’s requested natural width.
This is useful in cases where an attempt should be made to allocate exactly enough space for the natural size of the child.
Its value is a boolean.
Set it with (set! (scrolled-window:propagate-natural-width self)
value).
The <GtkAdjustment> for the vertical position.
Its value is a <GtkAdjustment>, or #f.
Set it with (set! (scrolled-window:vadjustment self) value).
When the vertical scrollbar is displayed.
Use scrolled-window:set-policy
to set this property.
Its value is a <GtkPolicyType> (or, to set it,
one of its symbols).
Set it with (set! (scrolled-window:vscrollbar-policy self)
value).
Where the contents are located with respect to the scrollbars.
Its value is a <GtkCornerType> (or, to set it,
one of its symbols).
Set it with (set! (scrolled-window:window-placement self) value).
Gets the child widget of self.
If the scrolled window automatically added a
<GtkViewport>, this function will return the
viewport widget, and you can retrieve its child using
viewport:get-child.
Passed: a <GtkScrolledWindow>.
Returned: a <GtkWidget>, or #f.
the child widget of self
Returns the horizontal scrollbar’s adjustment.
This is the adjustment used to connect the horizontal scrollbar to the child widget’s horizontal scroll functionality.
Passed: a <GtkScrolledWindow>.
Returned: a <GtkAdjustment>.
the horizontal <GtkAdjustment>
Gets whether the scrolled window draws a frame.
Passed: a <GtkScrolledWindow>.
Returned: a boolean.
#t if the self has a frame
Returns the horizontal scrollbar of self.
Passed: a <GtkScrolledWindow>.
Returned: a <GtkWidget>.
the horizontal scrollbar of the scrolled window.
Returns the specified kinetic scrolling behavior.
Passed: a <GtkScrolledWindow>.
Returned: a boolean.
the scrolling behavior flags.
Returns the maximum content height set.
Passed: a <GtkScrolledWindow>.
Returned: a 32-bit integer.
the maximum content height, or -1
Returns the maximum content width set.
Passed: a <GtkScrolledWindow>.
Returned: a 32-bit integer.
the maximum content width, or -1
Gets the minimal content height of self.
Passed: a <GtkScrolledWindow>.
Returned: a 32-bit integer.
the minimal content height
Gets the minimum content width of self.
Passed: a <GtkScrolledWindow>.
Returned: a 32-bit integer.
the minimum content width
Returns whether overlay scrolling is enabled for this scrolled window.
Passed: a <GtkScrolledWindow>.
Returned: a boolean.
#t if overlay scrolling is enabled
Gets the placement of the contents with respect to the scrollbars.
Passed: a <GtkScrolledWindow>.
Returned: a <GtkCornerType>.
the current placement value.
Retrieves the current policy values for the horizontal and vertical scrollbars.
See scrolled-window:set-policy.
Passed: a <GtkScrolledWindow>.
Returned: a <GtkPolicyType>.
location to store the policy for the horizontal scrollbar
Returned: a <GtkPolicyType>.
location to store the policy for the vertical scrollbar
Reports whether the natural height of the child will be calculated and propagated through the scrolled window’s requested natural height.
Passed: a <GtkScrolledWindow>.
Returned: a boolean.
whether natural height propagation is enabled.
Reports whether the natural width of the child will be calculated and propagated through the scrolled window’s requested natural width.
Passed: a <GtkScrolledWindow>.
Returned: a boolean.
whether natural width propagation is enabled.
Returns the vertical scrollbar’s adjustment.
This is the adjustment used to connect the vertical scrollbar to the child widget’s vertical scroll functionality.
Passed: a <GtkScrolledWindow>.
Returned: a <GtkAdjustment>.
the vertical <GtkAdjustment>
Returns the vertical scrollbar of self.
Passed: a <GtkScrolledWindow>.
Returned: a <GtkWidget>.
the vertical scrollbar of the scrolled window.
Creates a new scrolled window.
Returned: a <GtkWidget>.
a new scrolled window
Sets the child widget of self.
If child does not implement the
<GtkScrollable> interface, the scrolled window
will add child to a <GtkViewport> instance
and then add the viewport as its child widget.
Passed: a <GtkScrolledWindow>.
Passed, or left out: a <GtkWidget>, or #f.
the child widget
Sets the <GtkAdjustment> for the horizontal
scrollbar.
Passed: a <GtkScrolledWindow>.
Passed, or left out: a <GtkAdjustment>, or
#f.
the <GtkAdjustment> to use, or #f to
create a new one
Changes the frame drawn around the contents of self.
Passed: a <GtkScrolledWindow>.
Passed: a boolean.
whether to draw a frame around scrolled window contents
Turns kinetic scrolling on or off.
Kinetic scrolling only applies to devices with source
touchscreen.
Passed: a <GtkScrolledWindow>.
Passed: a boolean.
#t to enable kinetic scrolling
Sets the maximum height that self should keep visible.
The self will grow up to this height before it starts scrolling the content.
It is a programming error to set the maximum content height to a value
smaller than scrolled-window:min-content-height.
Passed: a <GtkScrolledWindow>.
Passed: a 32-bit integer.
the maximum content height
Sets the maximum width that self should keep visible.
The self will grow up to this width before it starts scrolling the content.
It is a programming error to set the maximum content width to a value
smaller than scrolled-window:min-content-width.
Passed: a <GtkScrolledWindow>.
Passed: a 32-bit integer.
the maximum content width
Sets the minimum height that self should keep visible.
Note that this can and (usually will) be smaller than the minimum size of the content.
It is a programming error to set the minimum content height to a value
greater than scrolled-window:max-content-height.
Passed: a <GtkScrolledWindow>.
Passed: a 32-bit integer.
the minimal content height
Sets the minimum width that self should keep visible.
Note that this can and (usually will) be smaller than the minimum size of the content.
It is a programming error to set the minimum content width to a value
greater than scrolled-window:max-content-width.
Passed: a <GtkScrolledWindow>.
Passed: a 32-bit integer.
the minimal content width
Enables or disables overlay scrolling for this scrolled window.
Passed: a <GtkScrolledWindow>.
Passed: a boolean.
whether to enable overlay scrolling
Sets the placement of the contents with respect to the scrollbars for the scrolled window.
The default is top-left, meaning the child is
in the top left, with the scrollbars underneath and to the right. Other
values in <GtkCornerType> are
top-right,
bottom-left, and
bottom-right.
See also scrolled-window:get-placement and
scrolled-window:unset-placement.
Passed: a <GtkScrolledWindow>.
Passed: a <GtkCornerType>, or one of its
symbols.
position of the child window
Sets the scrollbar policy for the horizontal and vertical scrollbars.
The policy determines when the scrollbar should appear; it is a value
from the <GtkPolicyType> enumeration. If
always, the scrollbar is always present; if
never, the scrollbar is never present; if
automatic, the scrollbar is present only if
needed (that is, if the slider part of the bar would be smaller than the
trough — the display is larger than the page size).
Passed: a <GtkScrolledWindow>.
Passed: a <GtkPolicyType>, or one of its
symbols.
policy for horizontal bar
Passed: a <GtkPolicyType>, or one of its
symbols.
policy for vertical bar
Sets whether the natural height of the child should be calculated and propagated through the scrolled window’s requested natural height.
Passed: a <GtkScrolledWindow>.
Passed: a boolean.
whether to propagate natural height
Sets whether the natural width of the child should be calculated and propagated through the scrolled window’s requested natural width.
Passed: a <GtkScrolledWindow>.
Passed: a boolean.
whether to propagate natural width
Sets the <GtkAdjustment> for the vertical
scrollbar.
Passed: a <GtkScrolledWindow>.
Passed, or left out: a <GtkAdjustment>, or
#f.
the <GtkAdjustment> to use, or #f to
create a new one
Unsets the placement of the contents with respect to the scrollbars.
If no window placement is set for a scrolled window, it defaults to
top-left.
Passed: a <GtkScrolledWindow>.
Connect a handler with (connect object
scrolled-window:edge-overshot handler). It is called as (handler
self pos).
Emitted whenever user initiated scrolling makes the scrolled window firmly surpass the limits defined by the adjustment in that orientation.
A similar behavior without edge resistance is provided by the
scrolled-window:edge-reached signal.
Note: The pos argument is LTR/RTL aware, so callers should be aware too if intending to provide behavior on horizontal edges.
Passed: a <GtkScrolledWindow>.
Passed: a <GtkPositionType>.
edge side that was hit
Connect a handler with (connect object
scrolled-window:edge-reached handler). It is called as (handler
self pos).
Emitted whenever user-initiated scrolling makes the scrolled window exactly reach the lower or upper limits defined by the adjustment in that orientation.
A similar behavior with edge resistance is provided by the
scrolled-window:edge-overshot signal.
Note: The pos argument is LTR/RTL aware, so callers should be aware too if intending to provide behavior on horizontal edges.
Passed: a <GtkScrolledWindow>.
Passed: a <GtkPositionType>.
edge side that was reached
Connect a handler with (connect object
scrolled-window:move-focus-out handler). It is called as
(handler self direction-type).
Emitted when focus is moved away from the scrolled window by a keybinding.
This is a keybinding signal.
The default bindings for this signal are Ctrl+Tab to move forward and Ctrl+Shift+Tab‘ to move backward.
Passed: a <GtkScrolledWindow>.
Passed: a <GtkDirectionType>.
either tab-forward or
tab-backward
Connect a handler with (connect object
scrolled-window:scroll-child handler). It is called as (handler
self scroll horizontal) ⇒ %return.
Emitted when a keybinding that scrolls is pressed.
This is a keybinding signal.
The horizontal or vertical adjustment is updated which triggers a signal that the scrolled window’s child may listen to and scroll itself.
Passed: a <GtkScrolledWindow>.
Passed: a <GtkScrollType>.
a <GtkScrollType> describing how much to scroll
Passed: a boolean.
whether the keybinding scrolls the child horizontally or not
Returned: a boolean.
whether the scroll happened