I just looked into the code: the widget is initialized with
> default_callback() as its callback_ function; do_callback() calls
> callback_ unconditionally and decides whether to call clear_changed()
> or not after the callback, depending on "callback_ != default_callback".
>
> Thus, we could do whatever we want in do_callback(), i.e. call
> action() before or after the callback, or instead of it, if ...
>
> Albrecht

IMHO, I believe that, would we add this action() virtual method,
the protoype should be :

virtual int action();

And then action() should be called _before_ the potential do_callback(), here's 
why:

By analogy of handle(), it would permit to decide in a similar way by the 
return code if we must call the default callbacks or not ...

This would a be a simple, yet powerful way to 'rewire' event handling or add 
another level of indirection (i.e: check preconditions before callbacks are 
called for any derived widget) for all derived classes that would need this 
default behavior ...

just my 2 cents.

--Fabien


_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to