Repository navigation
v0.2.0
titrmlib v0.2.0
A rework of rendering and input, plus scenes, overlays, new widgets and color.
New
- Faster screen updates: each panel keeps what was printed into it, and only cells that changed are redrawn. A typical update takes under 50 ms.
- No lost key presses: keys are queued, and the keypad is read even while a slow frame is drawing.
- Scenes: several full-screen layouts, one shown at a time, each with its own event handler (
term_scene_new,term_scene_switch). - Overlays: dialogs drawn on top of a scene, which give focus back when they close (
term_overlay_open,term_overlay_open_centered). - Widgets: new button and checkbox widgets. The text widget now scrolls and can follow new output, so it also works as a log.
- Custom widgets: give any panel your own key handling (
term_panel_set_keys) and send your own events (term_panel_send). Panels also get alignment, a focus style and an[enter]-to-submit option. - Color: foreground and background colors per panel (
term_panel_set_colors,TERM_COLOR_*). Panels split from a colored panel start with its colors. - Events: new
TERM_EV_CHANGE,TERM_EV_FOCUS_LOST,TERM_EV_SCENE_ENTERandTERM_EV_SCENE_LEAVE.
Breaking changes
- Focus is now controlled by the app.
term_focus_nextis removed, and[vars]arrives asTERM_KEY_VARS; callterm_focusyourself. - The log widget is removed; use a text widget with
term_text_appendandterm_text_autoscroll. term_panel_set_drawis removed. Output stays until you change it, so print when your state changes.- The event handler now returns
bool:trueif it handled the event. - The keypad is read with keypadc, so the CE C libraries must be on the calculator.
Using titrmlib
-
Unzip
titrmlib-v0.2.0.zipinto your CEdev project'slib/folder, givinglib/titrmlib/. -
Add its sources to your project's makefile:
CFLAGS = -Wall -Wextra -Oz -Ilib/titrmlib/src EXTRA_C_SOURCES = $(wildcard lib/titrmlib/src/*.c)
-
#include "titrm.h"and build withmake.
Keep the library inside your project directory: on Windows, CEdev can't build sources reached through ... The calculator needs the CE C libraries.
API reference: https://gavinhsmith.github.io/titrmlib/