
Elements C++ GUI Library - turrini
https://github.com/cycfi/elements
======
hannofcart
Firstly, this looks fantastic. And the GUI not taking over the main loop is a
wonderful feature. This is something that has really irritated me using most
other GUI libraries (including Qt).

> The GUI should be declared in C++ code.

While I love the declarative aspect of the above, would the authors consider
using a different DDL for layouts rather than C++?

The reason I ask is: this now enables creation of wrappers around this library
for other languages like Golang and Python.

Also, having the layouts described as plain data rather than C++ code would
allow not having to compile for minor UI/layout changes. Which will in turn
permit faster prototyping during UI development.

~~~
xamolxix
First time loading any of the examples it takes a noticeable time but it
creates some cache files e.g. "e33b398b592a74de7cce1c9035ee8082-le64.cache-7"
which seem binary. Subsequent loads are fast.

------
merlinsbrain
Looks cool! I wonder how this compares to Dear Imgui in terms of features. (I
understand this may not be an immediate mode toolkit, so not really discussing
that side of things)

Would the usual competitor to this be JUCE?

~~~
ablanco
I don't think so. JUCE includes an audio/dsp engine. This is only for UI

~~~
qppo
The DSP module in JUCE isn't production quality, and the audio I/O integration
in RtAudio is good enough for even professional use cases.

JUCE is really painful to use if you want to integrate it into anything
modern. It's old, it's slow, and you really can't make it better. I really
can't express how much distaste I have for JUCE after shipping multiple
products built on it - it solves _one_ hard problem (wrapping AU, AAX, and
VST3), other than that it is dog slow and can't be improved because the core
devs don't accept outside contribution for no reason except their own hubris.

Any cross platform UI in C++ that isn't JUCE or Qt is highly welcome.
Especially one that allows me to pull in external dependencies and use modern
build systems, test frameworks, CI/CD, and other tooling.

~~~
vmsp
Have you tried the latest version of JUCE? I think it supports cmake now.

~~~
wheels
I've actually been using JUCE with CMake for ages using this project:

[https://github.com/McMartin/FRUT](https://github.com/McMartin/FRUT)

It's meant to convert Projucer to CMake files, but we just create them
ourselves. The CMakeLists files come out a bit wonky, but it works.

------
vlovich123
What are the technical details behind how it avoids creating an event loop? Is
it just creating a UI thread that is doing the event loop work in the
background?

~~~
rightbyte
If there is no event loop I assume it has to be callbacks from the OS?

~~~
grishka
Isn't there still an event loop internally though even with callbacks?

~~~
rightbyte
I guess there need to be one somewhere unless you do hardware interrupts.

It seems to have an event loop though:

    
    
       void app::run()
       {
          MSG messages;
          while (_running && GetMessage(&messages, nullptr, 0, 0) > 0)
          {
             TranslateMessage(&messages);
             DispatchMessage(&messages);
          }
       }

~~~
ChrisSD
NOTE: That is the classic Win32 event loop.

------
ncmncm
This looks really great--fully modern C++ coded by the best of the best! If it
is like his other work, it will be a joy to use.

~~~
zerr
Ironically, the last update is the removal of Boost dependency :)

~~~
hellofunk
I’m curious, why is that ironic? Removing Boost dependencies in favor of
modern STL is a common and healthy chore.

~~~
zerr
Of course. Just the parent mentioned his other prominent projects - which are
several Boost libraries actually.

------
norswap
How does this do on the "integration" part of GUI? Like is it easy to spin a
"native" file picker on Windows/macOS?

(Sure there are native APIs for that, but bridging the gap is one of the point
of a cross-platform GUI framework, isn't it?)

------
rightbyte
Nice with effort being put into fesktop GUIs. It is really an area that
degraded alot I feel ... with many framewotks being just too complex and
interdependent on stuff so you can't keep the build quite clean.

------
rapsey
Is all rendering done using Cairo?

~~~
criddell
I was wondering if it uses native controls on each platfrom.

~~~
rapsey
No one does that anymore because the differences between platforms are too
large and there is no single platform native controls anyway.

~~~
stkdump
I wonder why this lesson we learnt from desktop GUI development doesn't apply
to mobile apps. Seems like the preferred approach there is to use native
controls.

~~~
rapsey
The APIs are better.

