pdwidgets.widgets.scroll_view

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

class pdwidgets.widgets.scroll_view.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)[source]

Bases: Widget

Clipped scrollable viewport with drag, wheel, and scrollbar.

property scroll_y

Current vertical scroll offset in pixels.

set_content_height(h)[source]

Update total scrollable content height.

Parameters:

h (int) – Content height in pixels (at least viewport height).

add_child(child)[source]

Add a child and expand content height if needed.

draw(area=None)[source]

Draw the viewport background.