Package: gtk
Class gtk:scrolled-window
Superclassesgtk:bin, gtk:container, gtk:widget, gtk:buildable, gobject:object, common-lisp:standard-object, common-lisp:t Documented SubclassesDirect SlotsDetails The gtk:scrolled-window widget is a container that accepts a single
child widget, makes that child scrollable using either internally added
scrollbars or externally associated adjustments, and optionally draws a
frame around the child. ![]() Figure: GtkScrolledWindow Widgets with native scrolling support, that is, those whose classes implement the gtk:scrollable interface, are added directly. For other types of widgets, the gtk:viewport class acts as an adaptor, giving scrollability to other widgets. The gtk:scrolled-window widgets implementation of the gtk:container-add function intelligently accounts for whether or not the added child is a gtk:scrollable widget. If it is not, the gtk:scrolled-window widget wraps the child in a gtk:viewport widget and adds that for you. Therefore, you can just add any child widget and not worry about the details. If the gtk:container-add function has added a gtk:viewport widget for you, you can remove both your added child widget from the gtk:viewport widget, and the gtk:viewport widget from the gtk:scrolled-window widget, like this: (let ((window (make-instance 'gtk:scrolled-window)) (child (make-instance 'gtk:button)))Unless the hscrollbar-policy and vscrollbar-policy properties are :never or :external, the gtk:scrolled-window widget adds internal gtk:scrollbar widgets around its child. The scroll position of the child, and if applicable the scrollbars, is controlled by the hadjustment and vadjustment properties that are associated with the gtk:scrolled-window widget. See the docs on the gtk:scrollbar widget for the details, but note that the step-increment and page-increment properties are only effective if the policy causes scrollbars to be present. If a gtk:scrolled-window widget does not behave quite as you would like, or does not have exactly the right layout, it is very possible to set up your own scrolling with the gtk:scrollbar widget and for example a gtk:grid widget. Touch supportThe gtk:scrolled-window widget 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 kinetic-scrolling property if it is undesired.The gtk:scrolled-window widget also displays visual 'overshoot' indication when the content is pulled beyond the end, and this situation can be captured with the "edge-overshot" signal. If no mouse device is present, the scrollbars will overlayed 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 overlay-scrolling property. CSS nodesThe gtk:scrolled-window implementation 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. Style Property Detailsscrollbar-spacing The scrollbar-spacing style property of type :int (Read) Number of pixels between the scrollbars and the scrolled window. Allowed values: >= 0 Default value: 3 scrollbars-within-bevel The scrollbars-within-bevel style property of type :boolean (Read) Whether to place scrollbars within the scrolled bevel of the window. Warning: The scrollbars-within-bevel style property has been deprecated since version 3.20 and should not be used in newly written code. The value of this style property is ignored. Default value: false Signal DetailsThe "edge-overshot" signallambda (window pos) :run-last
The "edge-reached" signallambda (window pos) :run-last
The "move-focus-out" signallambda (window direction) :action
The "scroll-child" signallambda (window scroll horizontal) :action
| Returned bySlot Access FunctionsInherited Slot Access FunctionsSee also |
2025-07-14