Skip to content

Scroll view

ScrollView is a base class for line api widgets.

ScrollView class

Bases: ScrollableContainer

A base class for a Widget that handles its own scrolling (i.e. doesn't rely on the compositor to render children).

is_scrollable property

is_scrollable: bool

Always scrollable.

refresh_lines method

def refresh_lines(self, y_start, line_count=1):

Refresh one or more lines.

Parameters
Name Type Description Default
y_start int

First line to refresh.

required
line_count int

Total number of lines to refresh.

1

scroll_to method

def scroll_to(
    self,
    x=None,
    y=None,
    *,
    animate=True,
    speed=None,
    duration=None,
    easing=None,
    force=False,
    on_complete=None
):

Scroll to a given (absolute) coordinate, optionally animating.

Parameters
Name Type Description Default
x float | None

X coordinate (column) to scroll to, or None for no change.

None
y float | None

Y coordinate (row) to scroll to, or None for no change.

None
animate bool

Animate to new scroll position.

True
speed float | None

Speed of scroll if animate is True; or None to use duration.

None
duration float | None

Duration of animation, if animate is True and speed is None.

None
easing EasingFunction | str | None

An easing method for the scrolling animation.

None
force bool

Force scrolling even when prohibited by overflow styling.

False
on_complete CallbackType | None

A callable to invoke when the animation is finished.

None