you don't have to: the code compiles and is valid C++ as-is without issues, unlike when you are using a normal library, say Qt, JUCE or similar.
Each user can then choose what they want to do with it. For instance, the same code can be put on some embedded chip without any UI processing and will be able to be plugged to hardware pretty easily by writing a few lines of simple glue code.
Ah, I think I understand now — basically what you’re describing is a schema for defining UI code as a tree of c++ structs.
…which, honestly, horrifies me.
I remember for a time I was adding drag and drop to various parts of blender (Ton went on his yearly vacation and this is what he brought back) and every little change required a rebuild to test which wasn’t the quickest on my little netbook. Mind you there was zero documentation and I was pretty deep in the innerds so there was a lot of trial and error involved. I literally spent most of the time waiting on the compiler because, well, I’m not the best coder out there.
Working on the UI code was a dream in comparison — edit code, reload python module, see changes, rinse and repeat.
> Ah, I think I understand now — basically what you’re describing is a schema for defining UI code as a tree of c++ structs.
yes :-)
> I literally spent most of the time waiting on the compiler
well, it being a tree of plain structs without 200kloc of header files to parse also means that it's possible to implement very fast live-recompilation, like this: https://youtu.be/fMQvsqTDm3k?t=87
Each user can then choose what they want to do with it. For instance, the same code can be put on some embedded chip without any UI processing and will be able to be plugged to hardware pretty easily by writing a few lines of simple glue code.