A clear advantage of making a callback an std::function is when more than one data arguments are necessary; this approach seems a clear improvement over macros FL_FUNCTION_CALLBACK_# and friends.
Yes. FL_FUNCTION_CALLBACK_# was my reaction one FLTK being stuck with C++98. In retrospect, my macros are implemented very similar to the implementation of capturing lambdas. If we decide to use this PR, I will mark all FL_FUNCTION_CALLBACK_# macros as deprecated.
I wonder whether class Fl_Callback_Interface could be used with Fl::add_timeout() to create a timeout?
Yes, but it needs a class. We would have to add a class like Fl_App_Timer with the callback interface. So the user could do stuff like:
I will check if it is possible to build a class that works as a function argument. It should be.
— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <fltk/fltk/pull/1597/c5522098396@github.com>
Comments are owned by the poster. All other content is copyright 1998-2026 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.