lookatme.widgets.line_fill module

class lookatme.widgets.line_fill.LineFill(beg_chars: str, fill_char: str, end_chars: str, beg_spec: Optional[urwid.display_common.AttrSpec] = None, fill_spec: Optional[urwid.display_common.AttrSpec] = None, end_spec: Optional[urwid.display_common.AttrSpec] = None, orientation: str = 'vertical')[source]

Bases: urwid.widget.Widget

Test

HORIZONTAL = 'horizontal'
VERTICAL = 'vertical'
pack(size: Tuple, focus: bool = False)[source]

See Widget.render() for parameter details.

Returns:A “packed” size (maxcol, maxrow) for this widget

Calculate and return a minimum size where all content could still be displayed. Fixed widgets must implement this method and return their size when () is passed as the size parameter.

This default implementation returns the size passed, or the maxcol passed and the value of rows() as the maxrow when (maxcol,) is passed as the size parameter.

Note

This is a new method that hasn’t been fully implemented across the standard widget types. In particular it has not yet been implemented for container widgets.

Text widgets have implemented this method. You can use Text.pack() to calculate the minimum columns and rows required to display a text widget without wrapping, or call it iteratively to calculate the minimum number of columns required to display the text wrapped into a target number of rows.

render(size, focus=False)[source]
rows(size, focus=False)[source]