Alf P. Steinbach writes:
> On 24.06.2020 16:38, Sam wrote:
>> Mr Flibble writes:
>>
>>> On 24/06/2020 12:05, Sam wrote:
>>>> Mr Flibble writes:
>>>>
>>>>> There isn't one and there never should be: we have neoGFX for that! :D
>>>>
>>>> Proposals for GUI libraries are accepted only from those who have actually
>>>> written one.
>>>
>>> I have written one, dear.
>>
>> Do you have a Youtube video, that shows it off? Where's the source
>> repository, I'm curious to look at it, to see if I can pick up some tips,
>> for mine's.
>
> I guess you can find Leigh's neoGFX easily just by googling it.
Yeah, Windows-based library, oriented towards game development, from the
looks of it.
Mine, on the other hand, is an X11 widget stack, Linux only, classic widget
set.
> Like him I've written a number of GUI libraries, but they've been minimal.
> In the 1990's I found it interesting to experiment with various ways to
> associate a Windows window with C++ object. In particular the trick used in
> Borland's framework, namely a /trampoline function/: a kind of pseudo
> function (as "window procedure") that just put an object address in a
> register and jumped to a common dispatch function.
My driver was a desire to get up to speed and learn C++11. Thinking about
what I could possibly practice on: writing an X11 widget stack was appealing
for some reason. I also found that learning X was quite interesting. I
intentionally set up my development environment to tunnel X over ssh, over a
wireless connection. This makes implementation inefficiencies very obvious.
These days, my toolkit targets C++20, after the introduction of constraints,
and other C++20 features, into my library.
> Later my interest for GUI framework design focused on providing the C++
> initialization guarantee, that after constructor execution you have a fully
> working usable object at hand, with class invariants established.
>
> I.e., no MFC-style two-phase or multi-phase construction.
Not familiar with MFC's two-phase construction, so I might be talking about
something else; but I did find a need for two-phase construction, for certain
specific use cases, myself. My definition of two-phase construction was a
requirement to call a class method after constructing an instance, in order
to finish something.
I found a workable solution by having the framework take care of it, without
really having to explicitly invoke the 2nd phase. I don't have to call the
2nd phase constructor, every time, myself. All my widgets and other objects
gets constructed by templates, and the templates use SFINAE to determine
whether the constructed class instance has a second phase constructor; and
if so invoke it automatically. Objects with a second phase constructor end
up getting instantiated identically to regular objects, without having to
think about it. Completely exception safe.
> <url:
https://github.com/alf-p-steinbach/winapi>.
https://www.libcxx.org/w/