TreeBox is essentially a urwid.ListBox that displays a given Tree. Per default no decoration is used and the widgets of the tree are simply displayed line by line in depth first order. TreeBox‘s constructor accepts a focus parameter to specify the initially focussed position. Internally, it uses a TreeListWalker to linearize the tree to a list.
TreeListWalker serve as adapter between Tree and urwid.ListWalker APIs: They implement the ListWalker API using the data from a given Tree in depth-first order. As such, one can directly pass on a TreeListWalker to an urwid.ListBox if one doesn’t want to use tree-based focus movement or key bindings for collapsing subtrees.
A widget that displays a given Tree. This is essentially a ListBox with the ability to move the focus based on directions in the Tree and to collapse/expand subtrees if possible.
TreeBox interprets left/right as well as page up/`page down to move the focus to parent/first child and next/previous sibling respectively. All other keys are passed to the underlying ListBox.
Collapse currently focussed position; works only if the underlying tree allows it.
ListWalker to walk through a class:Tree.
This translates a Tree into a urwid.ListWalker that is digestible by urwid.ListBox. It uses Tree.[next|prev]_position to determine the next/previous position in depth first order.