Hi,
I'm wondering if there is any way of placing a gobal callback function as  a 
class method. I encapsulated the Fl_Callback structure within a class but 
unable to use a corresponding callback as a class method. Basically, for a 
simple menubar:

// not able to place Sample_Callback as a MyMenubar method
void Sample_Callback(Fl_Widget *, void *)
{
..
}

// MyMenubar constructor
MyMenubar::MyMenubar(int x,int y,int w,int ):Fl_Menu_Bar(x,y,w,h,label)
{
 My_Menu_Item *Sample[] = {
  {&File,x,x,x,SUB_SUBMENU},
  ...
  {&Sample,x,Sample_Callback,x},
  {0},
  {0};

 this->copy(Sample);
}

Basically, I would like to encapsulate global functions into classes for 
cleaner looking and easier to debug the code.

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

Reply via email to