9 Comments
⭠ Return to thread

It may be just my lack of background knowledge, but I failed to understand some things.

So, you store the widgets of the previous frame in a hashmap, which you can access from the current frame's widget. You want to do this because the previous widgets are already calculated so you can know if the user clicked on something or not. Did I get this correct?

For some reason I still don't think I understood how to implement this.

Instead of caching all the widgets of the previous frame, can't you just pass a lambda with the code that would get executed if the user clicked? By the end of the frame, all the computations would be done so the GUI knows if the user clicked, so the lambda gets executed at the end of the frame.

This would be less clean user code but I still don't quite get how to implement the no-lambda version.

Expand full comment