Skip to content
docsv0.3.0

TuiRenderContext

The context a {@see \Milpa\Live\Contracts\Tui\TuiNodeRendererInterface} renders a single node within: the bounds it must fill, which node (if any) currently has keyboard focus, and — optionally — the full layout frame for renderers that need sibling/ancestor information beyond their own bounds.

TuiRenderContext::__construct()

public function __construct(Milpa\Live\ValueObjects\Tui\TuiBounds $bounds, ?string $focusedId = null, ?Milpa\Live\ValueObjects\Tui\TuiLayoutFrame $layout = null):

Parameters

Parameters of __construct()
NameTypeDescription
$boundsTuiBoundsThe exact region the renderer's output MUST fill.
$focusedId(string | null)The id of the currently focused node, if any.
$layout(TuiLayoutFrame | null)The full layout frame this render is part of, when available.

TuiRenderContext::focused()

public function focused(Milpa\Live\ValueObjects\Tui\TuiNode $node): bool

Whether the given node is the one currently focused.

Parameters

Parameters of focused()
NameTypeDescription
$nodeMilpa\Live\ValueObjects\Tui\TuiNode