I have created a widget that overrides handle(int). Inside handle, I want to
process various events depending on whether a callback for the widget has
been set.

For example,

int Fl_MyWidget::handle(int e)
{
   switch(e)
   {
      case FL_PUSH:
         if(callback())
         {
            fl_cursor(FL_CURSOR_HAND);
            return 1;
         }
         break;

     // other cases ...
   }
}

Then the app, assigns or removes the callback I defined as needed.

My problem is that when I create Fl_MyWidget, its callback is automagically
set to Fl::default_callback(). My questions are:

1. What is the purpose of this callback?
2. Is it safe to set the callback for Fl_MyWidget (in the ctor) to NULL? 3.
3. Also, the docs say that I _may_ want to use this default callback? If
so, for what purpose/what could I do with it?

Thanks.

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

Reply via email to