microfugue
v0.14.2
Published
a small library for creating UX elements in ansi-compatible terminals
Downloads
8
Readme
microfugue
a small library for creating UX elements in ansi-compatible terminals, using antsy.
EditBox
: a text editor which supports most basic unix line-editing control codes, and hooks for syntax highlighting and validation. it can be used as a multi-line editor where "enter" inserts new lines, or as a "readline" style command editor, where "enter" commits a line to the command history, and anAsyncIterator
provides the command lines.LogView
: renders an antsyCanvas
full of lines ofRichText
. lines are appended at the bottom. can be limited to storing a limited number of historical lines. lines are optionally word-wrapped.RichText
: text model consisting of (possibly nested) spans of text with a color attribute. can parse a simple format like"this is {f00:red}"
or you can generate the spans yourself.ScrollView
: fills an antsyRegion
with the contents of aCanvas
(likeLogView
) that can be scrolled vertically.StatusBar
: displays a one-line status bar, where the left and right half can be updated independently.Form
: a layout of input elements (text, buttons, checkboxes, selection lists, and edit boxes) with validation and navigation. a left column labels each row, and each row can be a single element, or a packed line of elements (like three buttons).
to-do
- shift-arrow, etc to mark text in an edit box (mwuhaha)
- C-c, C-v, C-x, C-z in an edit box