textual.scroll_view
ScrollView
is a base class for Line API widgets.
ScrollView
¶
ScrollView(
*children,
name=None,
id=None,
classes=None,
disabled=False,
can_focus=None,
can_focus_children=None,
can_maximize=None,
)
Bases: ScrollableContainer
A base class for a Widget that handles its own scrolling (i.e. doesn't rely on the compositor to render children).
name: The name of the widget.
id: The ID of the widget in the DOM.
classes: The CSS classes for the widget.
disabled: Whether the widget is disabled or not.
can_focus: Can this container be focused?
can_focus_children: Can this container's children be focused?
can_maximized: Allow this container to maximize? `None` to use default logic.,
refresh_lines
¶
refresh_lines(y_start, line_count=1)
scroll_to
¶
scroll_to(
x=None,
y=None,
*,
animate=True,
speed=None,
duration=None,
easing=None,
force=False,
on_complete=None,
level="basic",
immediate=False
)
Scroll to a given (absolute) coordinate, optionally animating.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
float | None
|
X coordinate (column) to scroll to, or |
None
|
|
float | None
|
Y coordinate (row) to scroll to, or |
None
|
|
bool
|
Animate to new scroll position. |
True
|
|
float | None
|
Speed of scroll if |
None
|
|
float | None
|
Duration of animation, if |
None
|
|
EasingFunction | str | None
|
An easing method for the scrolling animation. |
None
|
|
bool
|
Force scrolling even when prohibited by overflow styling. |
False
|
|
CallbackType | None
|
A callable to invoke when the animation is finished. |
None
|
|
AnimationLevel
|
Minimum level required for the animation to take place (inclusive). |
'basic'
|
|
bool
|
If |
False
|