Skip to content
ConsoleMonster

API Reference

Class

Stack

Namespace ConsoleMonster.Layout
Assembly ConsoleMonster
Implements
Modifiers sealed

Layers children on top of each other in the same region, in order: later layers paint over earlier ones. A layer replaces only the cells it writes, so the layers below stay visible around it. Combine with Align to place an overlay, for example a status badge in the top-right corner of a chart. For children placed one below another, use Rows.

Inheritance

  • Object
  • Stack

Constructors

public Stack(params IWidget[] layers) #

Creates a stack.

Parameters

layers ConsoleMonster.Layout.IWidget[] requiredposition: 0
The layers, bottom first.

Methods

public 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 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.

Properties

public IReadOnlyList<IWidget> Children { get; } #

The child widgets in layout order.