pdwidgets.widgets.list_view

Scrollable list container.

class pdwidgets.widgets.list_view.ListView(parent, x=0, y=0, w=None, h=None, align=None, align_to=None, fg=None, bg=None, visible=True, padding=None)[source]

Bases: Widget

Vertically scrollable list container.

add_child(child)[source]

Adds a child widget to the current widget.

remove_child(child)[source]

Removes a child widget from the current widget.

reassign_positions()[source]

Reassign the positions of all children after one is removed.

config_scrollbar()[source]

Configure the scrollbar based on the number of children.

scroll(sender)[source]

Read the value of the scrollbar and scroll the list view accordingly.

scroll_up()[source]

Scroll the list view up by one item.

scroll_down()[source]

Scroll the list view down by one item.

changed()[source]

Update the list view when the value changes.