Skip to content

scroll_view

pdwidgets.widgets.scroll_view

ScrollView — generic scroll container with clip + drag/wheel.

ScrollView(parent, x=0, y=0, w=None, h=None, align=None, align_to=None, fg=None, bg=None, visible=True, padding=None, content_h=None)

Bases: Widget

Clipped scrollable viewport with drag, wheel, and scrollbar.

Scrollable viewport. Children are offset by scroll_y; drawing is clipped to the padded area (Phase 0 clip_content).

scroll_y property writable

Current vertical scroll offset in pixels.

add_child(child)

Add a child and expand content height if needed.

draw(area=None)

Draw the viewport background.

set_content_height(h)

Update total scrollable content height.

Parameters:

Name Type Description Default
h int

Content height in pixels (at least viewport height).

required