A TVision/Turbo-Vision style character-cell UI toolkit written in ISO GNU
Modula-2 (gm2 -fiso) for the terminal, developed alongside the tigr and
microui bindings in this repository. No C source and no graphics
dependency; the only non-Modula-2 part is the libc binding tvtty.def.
Working milestone: a retained view tree with clipping and z-order, a diffed ANSI screen, keyboard + mouse input, widgets and modal dialogs. Builds warning-free and was exercised by driving a real pty (frames reconstructed from the captured terminal stream).
| file | role |
|---|---|
tvtty.def |
libc binding: raw mode, winsize, read/write |
tv.def / tv.mod |
screen, view tree, widgets, events, modal dialog |
demo.mod |
demo application (two windows, all widgets, mouse) |
ttysize.mod |
diagnostic for the tty binding |
Makefile |
build |
README.md |
build/run + API + GM2 notes |
X close box.Dialog/Dlg*/DlgRun) with inputs,
check boxes (self-exclusive radio groups) and tagged buttons; MessageBox
(OK / OK-Cancel / Yes-No) and the Message shorthand.signal handler.VEditor) with insert/overwrite, navigation,
Tab indent, mouse positioning, a Ln/Col/Insert/Modified status row and
file load/save; syntax highlighting for Modula-2/Pascal/Oberon and
automatic keyword up-casing and auto-indentation for Modula-2/Oberon
(indent after open keywords, dedent on close keywords); demo
examples/edit
(with a Syntax menu to switch language).empty, window, dialog, menus, edit, gfx); API
reference (API.md) and tutorial (TUTORIAL.md).tvg): the same view tree rendered in a window.
Text uses a bundled 8x16 monospaced VGA font (tvfont, public-domain IBM
VGA glyphs) so no system font is needed; box drawing is line segments;
tigr keyboard/mouse are mapped to tv events. tv.InitVirtual lets any driver set the
virtual screen size without touching the terminal.F10 to open, Left/Right switch
menus, Up/Down move, Enter/Space or click selects (returns the item tag);
separators supported.Driving the demo through a pty and reconstructing the screen:
OK with the mouse opens the modal Info box;File title opens the drop-down (New/Open/Sep/Quit), F10
Quit exits the program.SIGWINCH-driven relayout).See README.md: value-returning no-arg procedures need () in the .def;
pointer fields need ^; a BEGIN...END block cannot be a CASE branch;
INTEGER vs HIGH() comparisons need VAL; termios/winsize use fixed Linux
offsets. A subtle runtime bug was found and fixed in the ANSI output: SGR
attributes accumulate, so blink must be emitted explicitly as ;5/;25 or
it leaks into every following cell.