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
blockBlockBuilder
Returns
- TreeBuilder<T>
Draw(Buffer, Rect)
Draw the tree to the buffer.
public void Draw(Buffer buf, Rect area)
Parameters
Focused(bool)
Set whether the tree is focused: the border and selection use the focused styles.
public TreeBuilder<T> Focused(bool focused = true)
Parameters
focusedbool
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
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
guidesbool
Returns
- TreeBuilder<T>
HighlightStyle(Style)
A style patched over the theme's selection style.
public TreeBuilder<T> HighlightStyle(Style style)
Parameters
styleStyle
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
symbolstring
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
positionVec2?
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
columnsint
Returns
- TreeBuilder<T>
ShowScrollInfo(bool)
Show or hide scroll position info in the title (default: true).
public TreeBuilder<T> ShowScrollInfo(bool show = true)
Parameters
showbool
Returns
- TreeBuilder<T>
Style(Style)
A style patched over the theme's text style.
public TreeBuilder<T> Style(Style style)
Parameters
styleStyle
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
titlestring
Returns
- TreeBuilder<T>