diff options
| author | Shav Kinderlehrer <shav@trinket.icu> | 2026-05-08 17:45:15 -0400 |
|---|---|---|
| committer | Shav Kinderlehrer <shav@trinket.icu> | 2026-05-08 17:45:15 -0400 |
| commit | 91e1dbfd946f8396709d83701a6651b5c2ca7bdc (patch) | |
| tree | c136edbd8480180a02b067450531aae611761ca0 /scm/extant-input.scm | |
| parent | e85467ec272826bed113c29042ea4db355b851a3 (diff) | |
| download | extant-91e1dbfd946f8396709d83701a6651b5c2ca7bdc.tar.gz extant-91e1dbfd946f8396709d83701a6651b5c2ca7bdc.zip | |
Embed guile for custom handlers and update UI
Adds support for writing custom handlers and sets the ui to be
properly centered and not move around while messages are added. Also
auto scrolls when the messages window gets too long.
Diffstat (limited to 'scm/extant-input.scm')
| -rw-r--r-- | scm/extant-input.scm | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/scm/extant-input.scm b/scm/extant-input.scm new file mode 100644 index 0000000..d50a7fe --- /dev/null +++ b/scm/extant-input.scm @@ -0,0 +1,15 @@ +(define-module (extant input) + #:export (register-handler!)) + +(define *handlers* '()) + +(define (register-handler! proc) + (set! *handlers* (cons proc *handlers*))) + +(define (dispatch-input text) + (let loop ((handlers *handlers*)) + (if (null? handlers) + `((text . "No handlers found!") + (style . "error")) + (let ((result ((car handlers) text))) + (or result (loop (cdr handlers))))))) |
