Table of Contents

Class RenderContext

Namespace
MiniTui
Assembly
MiniTui.dll

What a component needs to know while rendering: whether it's focused, the theme and the app.

public sealed class RenderContext
Inheritance
RenderContext
Inherited Members

Properties

App

The app.

public App App { get; }

Property Value

App

Focused

True when the component is on the focus chain.

public bool Focused { get; }

Property Value

bool

Hover

The pointer, while WithHover(bool) is on and the pointer is over this component (or a child of it) in the last frame, with no overlay above it (1.x spec §17.6). Null otherwise. Pass it to a builder's Hover to show what's under the pointer.

public Vec2? Hover { get; }

Property Value

Vec2?

Theme

The theme to draw with (Current).

public Theme Theme { get; }

Property Value

Theme

Methods

For(Component)

The context for rendering a child: focused when this one is and its focus scope focuses the child.

public RenderContext For(Component child)

Parameters

child Component

Returns

RenderContext

Hints(int)

Hints for the bindings in scope on the current focus chain (§9.5), truncated to fit.

public string Hints(int maxWidth)

Parameters

maxWidth int

Returns

string

Render(Component, Buffer, Rect)

Render a child: records its Area so the mouse can hit it (1.x spec §4.7), then calls child.Render(buf, area, For(child)).

public void Render(Component child, Buffer buf, Rect area)

Parameters

child Component
buf Buffer
area Rect