Skip to content

Scroll view

scroll_view

ScrollView

Bases: Widget

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

is_scrollable: bool property

Always scrollable.

is_transparent: bool property

Not transparent, i.e. renders something.

get_content_height(container, viewport, width)

Gets the height (number of lines) in the content area.

Parameters:

Name Type Description Default
container Size

Size of the container (immediate parent) widget.

required
viewport Size

Size of the viewport.

required
width int

Width of renderable.

required

Returns:

Type Description
int

The height of the content.

get_content_width(container, viewport)

Gets the width of the content area.

Parameters:

Name Type Description Default
container Size

Size of the container (immediate parent) widget.

required
viewport Size

Size of the viewport.

required

Returns:

Type Description
int

The optimal width of the content.

render()

Render the scrollable region (if render_lines is not implemented).

Returns:

Type Description
RenderableType

Renderable object.