3 ms·
I've used FLTK for an application. It relies heavily on opaque pointers and convention. The compiler will not help you out if you mess up. https://github.com/g
by triedthat 2y ago
I've used FLTK for an application. It relies heavily on opaque pointers and convention. The compiler will not help you out if you mess up.
https://github.com/gammasoft71/Examples_FLTK/blob/c6f630eaa320bce90d6d9096b0718166f0618e32/src/Controls/Input/Input.cpp#L11-L13 https://github.com/gammasoft71/Examples_FLTK/blob/c6f630eaa3...
- moal 2y agoYou can use dynamic_cast instead of reinterpret_cast. If the pointer isn't correct it would return null. A better solution is to subclass the widget, store a function pointer for the callback which takes the same class instead of an Fl_Widget, and call that in the callback: https://github.com/MoAlyousef/FLMH https://github.com/MoAlyousef/FLMH This uses a std::function for the captures but you can use a function pointer as well.