List¶
- class tanmatsu.widgets.List(*args, children: list[tanmatsu.widgets.base.Widget], item_height: int, **kwargs)¶
Bases:
Box,ScrollableWidget that holds a number of widgets of a uniform height, with a cursor to navigate between them.
- Parameters
children (list[Widget]) – The widgets the List should contain.
- property cursor: int¶
- Getter
Get cursor location, i.e., the index of the currently selected child.
- Setter
Set the cursor location.
- property children: list[tanmatsu.widgets.base.Widget]¶
- Getter
Get the children, i.e., the list items.
- Setter
Set the children.
- property active_child: Widget¶
- Getter
Get the currently active child widget (i.e., the widget that the cursor is currently pointing to).
- up()¶
Move the cursor up.
- down()¶
Move the cursor down.