progrfess scaffolding rgfw (next: consume events and add callbacks for events)

This commit is contained in:
2026-01-23 10:55:43 +00:00
parent df20641af1
commit b4573441fb
6 changed files with 36 additions and 31 deletions

View File

@@ -11,7 +11,7 @@ struct
hd :: tl => let val () = sendMsg hd in sendMsgs tl end
| [] => ()
fun update (app: AppType.app_type, inputMsg) =
fun updateOne (app: AppType.app_type, inputMsg) =
let
val time = Time.now ()
@@ -30,4 +30,18 @@ struct
in
app
end
fun updateLoop (pos, msgVec, app) =
if pos = Vector.length msgVec then
app
else
let
val msg = Vector.sub (msgVec, pos)
val app = updateOne (app, msg)
in
updateLoop (pos + 1, msgVec, app)
end
fun update app =
updateLoop (0, InputMailbox.getMessagesAndClear (), app)
end