-
-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v2: TUI UI – "higher level" abstractions #131
Milestone
Comments
robbielyman
added a commit
that referenced
this issue
Jun 20, 2024
event listeners may now optionally return a second value; all non-nil values will be presented to the caller of `seamstress.event.publish` as an array. (this is cribbed very heavily from mediator_lua.) in the case of `{ 'tui', ... }` events raised by seamstress itself, if any of the returned values are truthy, a draw event is triggered. by default, the last responder (priority 0) to `draw` calls `seamstress.tui.renderCommit` to actually push the updated cells to the terminal. this commit adds `Timer` to the Lua layer, similar to `metro` from norns / seamstress 1. some differences: no new threads are spawned, so there is no limit on the number of timers. the timer has not gone back to sleep during the callback, so `pattern_time`-style dynamic timers should be much simpler to program. the type is entirely implemented in Zig, (yet memory is fully Lua-owned) so there is no actual `timer.lua` file. `seamstress.update` is available as a timer which will spawn an update-into-possible-draw event when enabled. this represents partial progress towards #131.
robbielyman
added a commit
that referenced
this issue
Jun 20, 2024
event listeners may now optionally return a second value; all non-nil values will be presented to the caller of `seamstress.event.publish` as an array. (this is cribbed very heavily from mediator_lua.) in the case of `{ 'tui', ... }` events raised by seamstress itself, if any of the returned values are truthy, a draw event is triggered. by default, the last responder (priority 0) to `draw` calls `seamstress.tui.renderCommit` to actually push the updated cells to the terminal. this commit adds `Timer` to the Lua layer, similar to `metro` from norns / seamstress 1. some differences: no new threads are spawned, so there is no limit on the number of timers. the timer has not gone back to sleep during the callback, so `pattern_time`-style dynamic timers should be much simpler to program. the type is entirely implemented in Zig, (yet memory is fully Lua-owned) so there is no actual `timer.lua` file. `seamstress.update` is available as a timer which will spawn an update-into-possible-draw event when enabled. this represents partial progress towards #131.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
render
events periodically. render events should instead be requested by Lua.seamstress.update.time = 1/60
should request that seamstress emit anupdate
event at 60Hzmaking the value 0 or negative cancels the timer_, true
fromupdate
, a{ 'tui', 'draw' }
event is emitted{ 'tui', 'draw' }
if any of them return_, true
publish
?seamstress.tui
Pane
s contain other primitives and provide relative coordinatesButton
s respond to click events by calling a functionTab
s stack PanesThe text was updated successfully, but these errors were encountered: