class Obsctl::TUI::Renderer

Overview

ANSI renderer that turns a TUI model into bounded terminal rows.

Defined in:

obsctl/tui/renderer.cr

Constant Summary

DEFAULT_HEIGHT = 24
DEFAULT_WIDTH = 72
MIN_HEIGHT = 12
MIN_WIDTH = 40

Constructors

Instance Method Summary

Constructor Detail

def self.new #

[View source]

Instance Method Detail

def render(model : Model, io : IO = STDOUT, width : Int32 = DEFAULT_WIDTH, height : Int32 = DEFAULT_HEIGHT) : Nil #

Writes a full-screen frame and resets the previous-frame cache.


[View source]
def render_incremental(model : Model, io : IO = STDOUT, width : Int32 = DEFAULT_WIDTH, height : Int32 = DEFAULT_HEIGHT) : Nil #

Writes only changed rows after the first full frame.


[View source]
def reset : Nil #

Clears the previous-frame cache so the next incremental render repaints.


[View source]