Closed paulolieuthier closed 4 years ago
(Sorry for the late reply.)
I'm not sure exactly what you mean by separating GUI from application logic as the update()
method is the application logic and the view!
macro is the GUI, so they are already separated.
If you want to know how to better organize your application, I suggest you create multiple relm widgets and send messages between them. See the communication
example for an example of how to do that.
Hey, don't worry! I really enjoyed the project.
I mean separating into different modules in a way that the core module would not depend on relm or even gtk. Channels could be used to communicate events in a frontend-agnostic way.
You can still use the same way as in the communication example, sending messages using a handle to a widget.
If you want to send a message from another thread, there's a Channel
in relm. See this example for usage.
I saw the examples and relm's Channel
, but still struggled. I will revisit it soon and create more specific issues if needed.
A more elaborate example would still be nice. :smile:
How would you go about separating GUI from application logic? I'm trying to use channels but I'm having a hard time. It would be nice to see an example like a simple chat application with a separate modules for storing messages, configuration etc.