A container whose content can be larger than the widget.
See scroll_view().
Super class
Widget -> ScrollView
Public fields
focusableScroll views can take focus so they can be scrolled with the keyboard even without focusable children.
direction"vertical","horizontal"or"both".scrollbarsDraw scroll bars when the content overflows?
Active bindings
offset_x, offset_yScroll offsets in cells (reactive).
viewportThe visible content rectangle (after the last layout).
virtual_sizeSize of the scrollable content:
c(width, height).max_scrollLargest offsets:
c(x, y).
Methods
Inherited methods
Widget$add_class()Widget$ancestors()Widget$animate()Widget$bind()Widget$bind_reactive()Widget$bindings()Widget$blur()Widget$capture_mouse()Widget$clear()Widget$computed_style()Widget$content_height()Widget$content_width()Widget$focus()Widget$format()Widget$get_state()Widget$has_class()Widget$invalidate()Widget$invalidate_paint()Widget$is_displayed()Widget$is_enabled()Widget$layout_differs()Widget$matches()Widget$mount()Widget$on()Widget$post_message()Widget$print()Widget$pseudo_states()Widget$query()Widget$query_one()Widget$refresh()Widget$release_mouse()Widget$remove()Widget$remove_children()Widget$remove_class()Widget$render()Widget$render_lines()Widget$replace()Widget$run_action()Widget$run_process()Widget$run_worker()Widget$set()Widget$set_interval()Widget$set_state()Widget$set_timeout()Widget$toggle_class()Widget$walk()
ScrollView$new()
Create a scroll view. See scroll_view().
Usage
ScrollView$new(
...,
direction = "vertical",
scrollbars = TRUE,
focusable = TRUE,
id = NULL,
classes = NULL,
style = NULL,
disabled = FALSE
)Arguments
...Child widgets.
directionScroll direction.
scrollbarsShow scroll bars?
focusableCan the scroll view itself be focused?
id, classes, style, disabledSee Widget.
ScrollView$scroll_to()
Scroll to an absolute position (in cells). Positions are clamped to the scrollable range at the next layout.
ScrollView$scroll_into_view()
Scroll so that a descendant is fully visible (as far as possible). Uses the last layout; the app re-lays out afterwards.
ScrollView$on_mouse_scroll()
The mouse wheel scrolls by three lines. When the view cannot scroll further, the event bubbles to outer scroll views.
ScrollView$arrange_children()
Lay the children out in a virtual area, shifted by the scroll offsets; reserves space for scroll bars when needed.
ScrollView$layout_descend()
Children entirely outside the viewport are not laid out in detail (unless a complete layout is needed, e.g. to scroll a focused widget into view).
ScrollView$paint()
Paint background, border and scroll bars.
Arguments
bufferA ScreenBuffer.
areaVisible part of the region.
stComputed style.