Skip to content

TextBlockNode

Namespace: Hex1b

Assembly: Hex1b.dll

Render node for displaying text content. Created by reconciling a .

csharp
public sealed class TextBlockNode : Hex1bNode

Inheritance

ObjectHex1bNodeTextBlockNode

Properties

Overflow

Gets or sets how text handles horizontal overflow.

Returns: TextOverflow

csharp
public TextOverflow Overflow { get; set; }

Text

Gets or sets the text content to display.

Returns: String

csharp
public string Text { get; set; }

Methods

MeasureCore(Constraints)

Measures the size required to display the text within the given constraints.

Parameters:

  • constraints (Constraints): The size constraints for layout.

Returns: Size

The measured size. For mode, height may be greater than 1 if text wraps to multiple lines.

csharp
protected override Size MeasureCore(Constraints constraints)

Render(Hex1bRenderContext)

Renders the text to the terminal using the current render context.

Parameters:

  • context (Hex1bRenderContext): The render context providing terminal access and inherited styling.
csharp
public override void Render(Hex1bRenderContext context)

Remarks

TextBlockNode handles measuring, arranging, and rendering text with support for different overflow behaviors: overflow (clipped by parent), wrapping, and ellipsis truncation.

This node is not focusable and does not handle input. For editable text, see .

Released under the MIT License.