Thanks to some template magic, I managed to link components to member functions dynamically. Amazing stuff is possible with modern C++ (looking forward to C++20 with some reflection finally coming)
Whatever, this opens up a great perspective on declarative UI architectures. I have a rudimentary prototype running already, but it will take me some time to come up with a comprehensive example. I’ll be happy to share it then.
Reading some discussions on declarative UI frameworks on this forum, I want to point out that this is way more than just about building a component hierarchy and handling design and layout. I’d say that’s just 50%
The other half is effective communication between user code and UI, which also benefits a lot from being as declarative and lean (non-verbose) as possible. I believe I’ve got something evolving here.
During the past 12 years I have worked with (and extended) UI frameworks for very large applications in other languages and am in the process of porting some of the most successful concepts to C++ and Juce. It won’t be easy, but I’m quite positive. A framework that helped me code and maintain several thousand classes in only a few years can’t be too bad after all.
Will be back with some examples, hopefully soon.