Replies: 1 comment
-
That example is just to illustrate the conceptual logic, but Lager is designed to interact with a more modern "event loop" system. The Lager itself provides a few of these "event loop" implementations. You can check You can try inspire yourself using the existing code as basis and try to do it. I can answer further questions if you have some. I'd also be happy to accept a PR that adds wxWidgets support if you wanna! PS. I couldn't resist myself and took a quick look at how the approach would be. It seems to me that a viable approach that reuses the existings mechanism would be to use the existing |
Beta Was this translation helpful? Give feedback.
-
I was wondering if anyone has tried using immer in a wxWidgets app, and whether they were able to implement the unidirectional dataflow architecture (as per the "canonical" example from Juanpe's 2017 talk):
Obviously this is at odds with the wxWidgets architecture, which implements the event loop as an internal detail, and exposes customization points for each possible event.
Currently my wxApplication class holds the application state as a member variable, and my derived widget classes hold references to the wxApplication class so their event handlers can mutate that state. This doesn't feel much in the spirit of value oriented design, but more like a lazy compromise in order to work around the expectations of the wxWidgets API.
Has anyone found a neater solution? wxWidgets will let you write a custom event loop, but this would also require a whole layer to interface between the wxWidgets event/widget API and a new immer-centric API where events return a value which can be passed to
update()
.Probably some people will suggest that I use dear imgui or similar, but I'm really after a "native look and feel" and wxWidgets is the only framework I've found which can do that in a cross-platform way.
Beta Was this translation helpful? Give feedback.
All reactions