FLTK logo

Re: [fltk.general] C++ GUI Standard Proposal - FLTK?

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: C++ GUI Standard Proposal - FLTK? Mo_Al_ Feb 02, 2023  
  I think with C++23 modules, it would be possible to distribute module units as well as the headers. The module units could just expose a more modern api along with namespaces:

// window.cppm
module;
// global module fragment, Fl_Window.H symbols are not exported to users
#include <FL/Fl_Window.H>

export module window;

export namespace fltk::window {
    export using Window = Fl_Window;
    export using DoubleWindow = Fl_Double_Window;
}

// fl.cppm
module;

#include <FL/Fl.H>

export module fl;

export namespace fltk {
    export int run() {
        return Fl::run();
    }
}

// main.cpp
import fltk.fl;
import fltk.window;

int main() {
    fltk::window::DoubleWindow w{400, 300};
    w.end();
    w.show();
    fltk::run();
}
On Thursday, February 2, 2023 at 2:12:07 PM UTC+3 Matthias Melcher wrote:

Thanks for the link below. A very good read. 

As for FLTK in a standard proposal. FLTK1 is almost 30 years old now. It was based on the "C" API of the library Forms, later XForms, and is even to this day somewhat source code compatible. A lot of limitations from Forms went int the FLTK 1 API, for example, pulldown menu items are not full widgets and are accessed through a completely different API than widgets, even though they do just the same, be children of a group inside a window. And much more. The list would get long quickly.

Bill saw that very early on, and FLTK2 fixed many if not all of these flaws within a year or two of the release of FLTK1. FLTK2 was in intensive daily use at Digital Domain, our employer, back then, and rumour has it, at at least two other special effects houses. FLTK2 uses a namespace, has a better layout engine, treats menu items as widgets, and has an al-in-all better C++ interface.

But as it was, FLTK1 made it into Linux distros. FLTK2 did not. Core devs, including me, got stuck on 1 while there were a few great apps developed with 2, like Dillo. And while fltk1 got better and better in the backend, fully supporting macOS and even Android for a while, fltk2 become more and more incompatible, idling to halt, and eventually being downgraded to an eternal Alpha version, majorly pissing off fltk2 developers who did not want to go back to 1.

The final stab to the death of fltk2 was probably Stroustrup's book "Programming: Principles and Practise using C++" which used fltk1 to teach C++, diverging new users away from 2 back to 1. Not sure if we were the cause and Stroustrup lived with the symptoms, or if it was the other way around, but here we are. Well, the book was from 2009, so I guess fltk2 was finished by then already.

I tried to merge 1 and 2 into 3, providing an API that was compatible to both, but eventually gave up due to the lack of capabilities of C++. But I did a great job in adding to the confusion in the FLTK version system. 

To get back to the standard proposal, FLTK is flagellating itself to use original C++. No exceptions, no STL, heck, not even RTTI or templates. This is awesome if you need to compile some app for Windows'89, but it's also very much in the way of a modern GUI standard for C++ in 2026 and further into the future.

In conclusion, as much as I would love to help with developing a C++ standard for user interfaces - and I guess my 30 years of experience may be helpful - I have a strong feeling that FLTK is the wrong base to make this happen. I love FLTK for its simplicity. Using Qt would be a much bigger mistake, because it is so huge and unwieldy, but FLTK probably isn't it either.

Then again, have you looked at FLTK4 yet? ;-)

 - Matthias

may64...@gmail.com schrieb am Donnerstag, 2. Februar 2023 um 10:57:32 UTC+1:
I think it’s not worth the effort. Check this posting for example:

--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/1ceba934-b75d-4951-bb2c-b19c91e380fen%40googlegroups.com.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.