> All I was actually saying is that the Widget::callback API is not type safe 
> and could one come up with a better API.  I think if one rules out using 
> templates then the answer is no.  This is fine, as I said, it's not bad.
>
> Mike.
>

An extremely simple way to accomplish this goal is to make
Fl_Widget::do_callback() a virtual method. Derived classes
could then implement their own (presumably) type safe callbacks,
or use functors, or do anything else.

The down side is that one would have to subclass in order to
obtain type safety in callbacks; that wouldn't be an issue for me,
since I use un-subclassed Widgets approximately never, but it may
well be one for others.

I should note that I'm a big fan of templates, and agree that
use of a standard conforming compiler is a reasonable requirement.
I just don't think that sort of solution is necessary in this case.

Best,
Stan

_______________________________________________
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to