How loganzartman/tuicalc works
tuicalc is a four-function terminal calculator. Its principal workflow is terminal mouse/keyboard input into calculator state, followed by formatted display rendering. The separate layout module computes geometry, hit-tests controls, and renders styled boxes. The README documents mouse interaction and keyboard input; layout behavior is supported by sampled source, while the JSON layout contents were not sampled.
Main entry points: calc.py Calculator app · layout.py Layout engine · layout.json UI layout
Components 11
Calculator app
- Calculator app
calc.py - Input handling
calc.py - Calculator state
calc.py - Formatted display
calc.py
Terminal layout
- UI layout
layout.json - Layout engine
layout.py - Geometry and hit tests
layout.py - Screen renderer
layout.py
Other components
- User
- Terminal UI
- termpixels
Connections 12
- User → Terminal UI: interacts
- Terminal UI → Input handling: delivers input
- Calculator app → UI layout: loads
- Calculator app → Layout engine: computes layout
- Calculator app → Geometry and hit tests: hit-tests
- Input handling → Calculator state: updates
- Calculator app → Formatted display: formats value
- Formatted display → Layout engine: sets text
- Layout engine → Geometry and hit tests: computes positions
- Layout engine → Screen renderer: renders layout
- Screen renderer → Terminal UI: draws screen
- Calculator app → termpixels: uses app and screen