Re:Writing GUI apps for Windows is painful
by moal on Monday July 01, 2024 @12:23PM
(#40847312)
You 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
This uses a std::function for the captures but you can use a function pointer as well.
[ Parent
| on HN ]
There are no comments on this comment yet.