> I propose to make this modification on the official FLTK sources.
> 
> Changes:
> from: void do_callback(Fl_Widget* o,void* arg=0);
> to: virtual void do_callback(Fl_Widget* o,void* arg=0);
> 
> With this modification examples like this works:
> 
> ------
> load DaoFLTK;
> 
> class Button1 : Fl_Button
> {
>    sub do_callback( w : Fl_Widget, a : cdata ){
>      io.write( '\07' );
>      io.flush();
>    }
> }
> class Button2 : Fl_Button
> {
>    sub do_callback( w : Fl_Widget, a : cdata ){
>      std.exit(0);
>    }
> }


I'm guessing what the shown syntax means, but is that over-riding the
do_callback() method with the actual callback functionality?

Surely that is *not* how do_callback() is meant to be used?

The "Right Thing" to do is to leave do_callback() alone and override the
widget's callback method (that do_callback() will call) to implement the
callback functionality.

What am I missing here? Is there some reason why you have to molest the
do_callback() method in this way?


Also - can we demonstrate that there is no performance impact from
virtualising this method? Presumably that will [often | usually] mean an
extra level of indirection on each callback event...?



SELEX Galileo Ltd
Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14 
3EL
A company registered in England & Wales.  Company no. 02426132
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************

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

Reply via email to