I'm experimenting with dao http://daovm.net/ and his author did an 
amazing job creating a automated tool that can create bindings to almost 
all fltk 1.3 including deriving fltk classes, but for it to work with 
callbacks easily he needs to make "void do_callback(Fl_Widget* o,void* 
arg=0)" a virtual function.

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);
   }
}

window = Fl_Window(320,65);
b1 = Button1(20, 20, 80, 25, '&Beep');
b2 = Fl_Button(120,20, 80, 25, '&no op');
b3 = Button2(220,20, 80, 25, 'E&xit');
window.end();
window.show();
Fl.run();
------
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to