The problem with all the callback mechanisms is that they required 
Widget to be changed, thus making it impossible to "try" them in fltk.

In fltk2.0 there was an attempt to add an "attribute" to any widget, 
stored in a hash table keyed by widget+attributeclass. Destruction of 
the widget would destroy any attached attributes. The primary intention 
was so any callback mechanism could put it's data here, but nobody has 
used it for that. Currently it is used to store shortcut bindings only.

I do think the idea is correct, however.

Ken Yarnall wrote:
> Mike wrote:
>> True, templatizing the entire Widget class would cause code bloat
>> which is why one would be mad to do it.  It is possible to implement
>> the template m/f I suggested without templatizing the whole widget
>> class.  For example:
>>
> 
> I implemented a replacement for the fltk callback mechanism a few years
> ago called fl_connect:
> 
>     http://cscdev.lvc.edu/fl_connect
> 
> I haven't maintained that website in awhile (apologies), but the code
> ports without problems to fltk-1.1.x (I've patched v1.1.8, for instance).
_______________________________________________
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to