Table of Contents

Class TreeBuilder<T>

Namespace
MiniTui
Assembly
MiniTui.dll

A bordered, scrollable tree with a selection (1.x spec §11.5).

public class TreeBuilder<T> where T : class

Type Parameters

T
Inheritance
TreeBuilder<T>
Inherited Members

Examples

Widget.Tree(tree).Title("Files").Guides().Focused(ctx.Focused).Draw(buf, area);

Methods

Block(BlockBuilder)

The border around the tree. By default, a single-line border on all sides.

public TreeBuilder<T> Block(BlockBuilder block)

Parameters

block BlockBuilder

Returns

TreeBuilder<T>

Draw(Buffer, Rect)

Draw the tree to the buffer.

public void Draw(Buffer buf, Rect area)

Parameters

buf Buffer
area Rect

Focused(bool)

Set whether the tree is focused: the border and selection use the focused styles.

public TreeBuilder<T> Focused(bool focused = true)

Parameters

focused bool

Returns

TreeBuilder<T>

Format(Func<T, Line>)

How a node is drawn. By default, its text from the state.

public TreeBuilder<T> Format(Func<T, Line> format)

Parameters

format Func<T, Line>

Returns

TreeBuilder<T>

Guides(bool)

Draw guide lines (│ ├─ └─) from each node to its parent, instead of indentation only.

public TreeBuilder<T> Guides(bool guides = true)

Parameters

guides bool

Returns

TreeBuilder<T>

HighlightStyle(Style)

A style patched over the theme's selection style.

public TreeBuilder<T> HighlightStyle(Style style)

Parameters

style Style

Returns

TreeBuilder<T>

HighlightSymbol(string)

A marker drawn before the selected row, such as "> ". Other rows are indented to match.

public TreeBuilder<T> HighlightSymbol(string symbol)

Parameters

symbol string

Returns

TreeBuilder<T>

Hover(Vec2?)

The pointer, usually Hover. Hover is patched over the row under it, unless it's the selected one (1.x spec §17.6).

public TreeBuilder<T> Hover(Vec2? position)

Parameters

position Vec2?

Returns

TreeBuilder<T>

Indent(int)

Columns per level without guides (default 2, at least 1). Guides always take 2.

public TreeBuilder<T> Indent(int columns)

Parameters

columns int

Returns

TreeBuilder<T>

ShowScrollInfo(bool)

Show or hide scroll position info in the title (default: true).

public TreeBuilder<T> ShowScrollInfo(bool show = true)

Parameters

show bool

Returns

TreeBuilder<T>

Style(Style)

A style patched over the theme's text style.

public TreeBuilder<T> Style(Style style)

Parameters

style Style

Returns

TreeBuilder<T>

Title(string)

Set the title. Scroll info such as [1-10 of 50] is appended unless turned off.

public TreeBuilder<T> Title(string title)

Parameters

title string

Returns

TreeBuilder<T>