done with scaffolding for file mailbox; next, send message to file mailbox to export and import, and handle these messages properly from the file mailbox
This commit is contained in:
@@ -3,6 +3,7 @@ sig
|
||||
val run:
|
||||
InputMessage.t Mailbox.mbox
|
||||
* DrawMessage.t Mailbox.mbox
|
||||
* FileMessage.t Mailbox.mbox
|
||||
* AppType.app_type
|
||||
-> unit
|
||||
end
|
||||
@@ -12,21 +13,21 @@ struct
|
||||
open CML
|
||||
open UpdateMessage
|
||||
|
||||
fun handleMsg (drawMailbox, updateMsg) =
|
||||
fun handleMsg (drawMailbox, fileMailbox, updateMsg) =
|
||||
case updateMsg of
|
||||
DRAW drawMsg => Mailbox.send (drawMailbox, drawMsg)
|
||||
| FILE fileMsg => ()
|
||||
| FILE fileMsg => Mailbox.send (fileMailbox, fileMsg)
|
||||
| NO_MAILBOX => ()
|
||||
|
||||
fun loop (inputMailbox, drawMailbox, model) =
|
||||
fun loop (inputMailbox, drawMailbox, fileMailbox, model) =
|
||||
let
|
||||
val inputMsg = Mailbox.recv inputMailbox
|
||||
val (model, updateMsg) = AppUpdate.update (model, inputMsg)
|
||||
val _ = handleMsg (drawMailbox, updateMsg)
|
||||
val _ = handleMsg (drawMailbox, fileMailbox, updateMsg)
|
||||
in
|
||||
loop (inputMailbox, drawMailbox, model)
|
||||
loop (inputMailbox, drawMailbox, fileMailbox, model)
|
||||
end
|
||||
|
||||
fun run (inputMailbox, drawMailbox, initial) =
|
||||
loop (inputMailbox, drawMailbox, initial)
|
||||
fun run (inputMailbox, drawMailbox, fileMailbox, initial) =
|
||||
loop (inputMailbox, drawMailbox, fileMailbox, initial)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user