Ben Henning wrote:
Apologies in advance that I haven't taken a look at the source, but is this an immediately rendered GUI system?
As i understand this is a question, immediate GUI versus retained GUI such as GTK and Qt.
It is not immediate GUI in the sense that it only renders the GUI elements, it is not that primitive.
The event and draw functions are called directly from the main loop. The rendering and the event processing is not hidden from the user different from a retained GUI, and user can add functionality to both. In that sense it is immediate GUI. This is good for games in that the GUI is not separated from the game, all is done in the same way.
There is always a question of the balance between storing something in the widget's structure (or somewhere else), or calculating it in the drawing (rendering) function. Calculating it in a drawing function provides more flexibility, in that less is calculated when creating the widget, and thus more in the widget's structure can be changed dynamically, after creating the widget, without any inconsistencies when drawing.
One disadvantage of that is speed, though that may not be the most important. The other disadvantage is that it makes the drawing and event functions more complex, which has to be avoided when keeping it small and simple. But it is not about, this and that is right, it is always a question of balance. In kiss_sdl, the absolute preference is that the default version has to be simple, so that the beginners can easily start to use it. And also that the code is simple, so it is easy to understand and thus also easy to change.
The beginners like the simplicity. The advanced users always see it as unnecessarily too restrictive. But the advanced users always know how to change it, and can do it easily. Like rewriting one widget is not so big change, but it may provide exactly what a user may need. Some users have suggested several changes already, maybe there should be some advanced version of it in addition to the simple version, or some repository of different versions.
What concerns simplicity, some beginners may not agree at all, they find very complicated and difficult to understand even the default version that is said to be simple. 2300 lines of code is not exactly a very simple code, even when it is clear and well written, but the matter is that it cannot be done more simply, provided that it also has to be rudimentary and general, to be useful for most common practical purposes. It takes some effort to learn it, and one doesn't even start that effort when one is not absolutely sure that this is the right thing to choose, is high quality, works well, is well documented, has a good technical support, can be used for most purposes one may have, and is also widely used by others who find it to be good. The requirements such that when they are all fully required, then this makes creating any new toolkit completely impossible. This makes keeping it small and simple, an even greater priority.
But providing everything for every possible case, like in the advanced GUI-s such as GTK and QT, is not a good idea, in that it makes the GUI much too complex. And complexity can never be completely hidden, so it also adds complexity to the code and makes the code less easy to understand. And worse than that, makes it inflexible, so that trying to do something that is not provided, requires dealing with and overcoming all the complexity.
So that all is a question of balance. It is said that a bow maker has to have a good sense of proportion, otherwise one cannot make a good bow.
If one knows some immediate GUI-s, one finds that it is not like that or another immediate GUI. There are different ways how immediate GUI-s can be made, and different ways how immediate GUI can be defined. When defining immediate GUI the most generally, in that the event processing and rendering is not hidden from the user, then it is an immediate GUI. But by some other definitions it may said to be a slightly retained GUI, in a very limited way.
kiss_sdl - Simple universal GUI widget toolkit for SDL2 https://github.com/actsl/kiss_sdl