Skip to content
ConsoleMonster

API Reference

Interface

IWidget

Namespace ConsoleMonster.Layout
Assembly ConsoleMonster
Modifiers abstract

The widget contract. A widget is a pure function of its definition, its state, the capabilities and the theme: the same inputs always produce the same cells. Implement it to get theming, glyph tiers, layout, live updates and every output mode for free.

Usage

Explore 109 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Accepted by parameters 73

Methods

public abstract Size Measure(Constraints constraints, RenderContext context) #
Returns: Size

Returns the size the widget wants within the constraints.

Parameters

constraints ConsoleMonster.Layout.Constraints requiredposition: 0
The space offered.
context ConsoleMonster.Canvas.RenderContext requiredposition: 1
Profile, theme and glyphs.

Returns

The desired size, never larger than the constraints.

public abstract Void Render(Region region, RenderContext context) #
Returns: Void

Renders into a region. The region may be smaller or larger than the measured size.

Parameters

region ConsoleMonster.Canvas.Region requiredposition: 0
The target region.
context ConsoleMonster.Canvas.RenderContext requiredposition: 1
Profile, theme and glyphs.