PistonDevelopers/conrod — pull request #35 by mitchmindtree (2014-08-09 19:18:44+00:00)
Title: Reworked the imperative Widget system into an Immediate Mode style with Improved Example.

I ended up spending the day re-working the classical style Widget system into the Immediate mode style as discussed here #26 -the IMGUI style actually has me getting a little excited about this whole GUI business. It's still super super early days, but I think some of the groundwork is starting to become a little clearer.

In this immediate mode style, Widgets are treated as algebraic data types storing the 'minimal' amount of data necessary for retaining state. This allows all 'widget's to be stored in a single UI Context (basically a wrapper for a HashMap).

Anyway, it's probably much easier to see the changes in the example, which is now way more exciting (things actually happen when you play with the widgets!).

There's still a lot that could be tidied up and clarified even within the small amount of work that is done, but I'm liking the immediate style of implementation along with the use of closures rather than callbacks - the whole thing feels a little more concise, rusty and context-aware, as opposed to having widgets hold references or being split across an init stage, callback, etc.

Must sleep for now, will jump back into tinkering when I wake up!