On 23.03.2010,a t 15:56, Michael Sweet wrote:
> On Mar 23, 2010, at 1:36 AM, Albrecht Schlosser wrote:
>> ...
>> Hmm, that's problematic as well, because we have a "default callback"
>> that enters a widget in the Fl::readqueue() that is used in some
>> internal functions [1]. Would this action() method be called before
>> or after entering the widget into the queue? Or would it be better to
>> use virtual int action() that returns 1 if the action was taken, and
>> if so, the widget wouldn't be entered into the default callback queue?
>
> Or the default implementation of action() could call do_callback(),
> which does the default callback stuff (IIRC)?

But the handle() methods call do_callback(), so this would be the
natural starting point of everything, unless we want to change
tons of code (including user code).

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
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to