Package: gtk
Class gtk-scrolled-window
Superclassesgtk-bin, gtk-container, gtk-widget, gtk-buildable, g-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. Widgets with native scrolling support, i.e. 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 Details
Signal DetailsThe "edge-overshot" signallambda (window pos) :run-lastThe signal is emitted whenever user initiated scrolling makes the scrolled window firmly surpass, i.e. with some edge resistance, the lower or upper limits defined by the adjustment in that orientation. A similar behavior without edge resistance is provided by the "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.
The "edge-reached" signallambda (window pos) :run-lastThe signal is 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 "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.
The "move-focus-out" signallambda (window direction) :actionThe signal is a keybinding signal which gets emitted when focus is moved away from the scrolled window by a keybinding. The "move-focus" signal is emitted with the direction value on this scrolled windows toplevel parent in the container hierarchy. The default bindings for this signal are the Tab+Ctrl and Tab+Ctrl+Shift keys.
The "scroll-child" signallambda (window scroll horizontal) :actionThe signal is a keybinding signal which gets emitted when a keybinding that scrolls is pressed. The horizontal or vertical adjustment is updated which triggers a signal that the scrolled windows child may listen to and scroll itself.
| Slot Access FunctionsInherited Slot Access FunctionsSee also |
*2021-10-14