Package
Widget-actors own their state, produce 2D styled-cell grids, and send them to a compositor that diffs and renders to the terminal.
Core Types¶
Cell— styled terminal character (char, width, fg, bg, attrs)Grid— 2D rectangle of cellsColor— ANSI color union (Default, Black, Red, ..., BrightWhite)CellAttrs— attribute bitfield constants (bold, dim, underline, blink, reverse)
Layout¶
PackOption— packing options (PackFixed, PackExpand, PackFill + padding)Alignment— container alignment (AlignStart, AlignCenter, AlignEnd)
Widgets¶
Label— single-line text display with alignmentTextBox— multi-line text display with optional word wrapHLine/VLine— horizontal/vertical line widgetsHBox/VBox— box containers with GTK2-style packing and alignmentFrame— single-child container with box border and optional title
Infrastructure¶
Compositor— composites widget grids, diffs, renders to TerminalOutput. Useregister_root+root.resize()for the common full-screen case.UIBuilder— declarative DSL parser for building widget treesInputActor— parses terminal input, routes events, manages focusTerminalOutput/TerminalInput— traits for I/O abstractionStdoutOutput/StdinInput— default implementationsTermSize— query terminal dimensions via ioctl
Widget Traits¶
Widget— base trait for all widget actors. Requiresstate()andrender().CompositeWidget— extends Widget for containers with child compositingWidgetParent— trait for anything that receives grids from childrenWidgetState— bundles common widget fields (parent, width, height, etc.)
Utilities¶
DrawingPrimitives— helper functions for drawing shapes into cell arraysAnsiEncoder— ANSI escape sequence encoderGridFactory— validated Grid construction
Public Types¶
- primitive AlignCenter
- primitive AlignEnd
- primitive AlignLookup
- primitive AlignStart
- type Alignment
- class Allocation
- type Anchor
- primitive AnsiEncoder
- primitive Backspace
- primitive Black
- primitive Blue
- primitive BrightBlack
- primitive BrightBlue
- primitive BrightCyan
- primitive BrightGreen
- primitive BrightMagenta
- primitive BrightRed
- primitive BrightWhite
- primitive BrightYellow
- class BuilderError
- actor Canvas
- class Cell
- primitive CellAttrs
- type CellTuple
- primitive Center
- primitive CharKey
- type Color
- primitive ColorLookup
- interface Colorable
- trait CompositeWidget
- actor Compositor
- primitive Cyan
- primitive Default
- primitive Delete
- primitive Differ
- primitive Down
- primitive DrawingPrimitives
- primitive East
- primitive End
- primitive Enter
- primitive Escape
- primitive F1
- primitive F10
- primitive F11
- primitive F12
- primitive F2
- primitive F3
- primitive F4
- primitive F5
- primitive F6
- primitive F7
- primitive F8
- primitive F9
- actor Frame
- primitive Green
- class Grid
- primitive GridCellOutOfBounds
- primitive GridFactory
- actor HBox
- actor HLine
- primitive Home
- primitive Horizontal
- primitive IncompleteSequence
- actor InputActor
- type InputEvent
- trait InputListener
- type InputParseError
- class InputParser
- primitive Insert
- type Key
- class KeyEvent
- actor Label
- primitive Left
- primitive LeftButton
- primitive Magenta
- primitive MiddleButton
- primitive ModeLookup
- primitive Modifiers
- type MouseAction
- type MouseButton
- class MouseEvent
- primitive Move
- primitive NoButton
- primitive North
- primitive NorthEast
- primitive NorthWest
- type PackAxis
- primitive PackExpand
- primitive PackFill
- primitive PackFixed
- type PackMode
- class PackOption
- primitive Packer
- primitive PageDown
- primitive PageUp
- class ParsedLine
- primitive Press
- primitive Rainbow
- primitive Red
- primitive Release
- class ResizeEvent
- primitive Right
- primitive RightButton
- primitive ScrollDown
- primitive ScrollUp
- primitive South
- primitive SouthEast
- primitive SouthWest
- actor Stack
- actor StdinInput
- actor StdoutOutput
- primitive Tab
- actor TabBar
- primitive TabHorizontal
- type TabOrientation
- primitive TabVertical
- primitive TermSize
- trait TerminalInput
- trait TerminalOutput
- actor TextBox
- primitive TokAdd
- primitive TokId
- primitive TokKeyValue
- primitive TokMode
- primitive TokPackEnd
- primitive TokPackStart
- primitive TokQuotedString
- primitive TokSize
- primitive TokWord
- class Token
- class UIBuilder
- primitive UIParser
- primitive UnrecognizedSequence
- primitive Up
- actor VBox
- actor VLine
- primitive Vertical
- class ViewPort
- primitive West
- primitive White
- trait Widget
- type WidgetFactory
- trait WidgetParent
- class WidgetState
- primitive Yellow