Hello,
i want a Fl_tree widget to call the callback function only if there is a double 
click. Because there is no FL_WHEN_DOUBLE_CLICK or something else I decided to 
use wid_waypoint_list.when(FL_WHEN_NEVER). With this option enabled, a callback 
should never happen. There is a handle function to recognize the double click. 
This works fine but despite the call to wid_waypoint_list.when(FL_WHEN_NEVER); 
there are also callbacks on every other widget action. Is anyone familiar with 
this problem?

Window_Main::Window_Main() : Fl_Double_Window(300,800,""),
        wid_waypoint_list(5,5,290,300)
{
        this->callback(static_cb_window,this);
        wid_waypoint_list.showroot(0);
        wid_waypoint_list.when(FL_WHEN_NEVER);
        wid_waypoint_list.callback(static_cb_wid_waypoint_list,this);
        end();
        show();
}

int Fl_Tree_mod::handle(int event)
{
        if(Fl::event_clicks())
        {
                do_callback();
                return 1;
        }
        return Fl_Tree::handle(event);
}

void Window_Main::static_cb_wid_waypoint_list(Fl_Widget *wi, void* v)
{
        ((Window_Main*)v)->cb_wid_waypoint_list();
}



inline void Window_Main::cb_wid_waypoint_list()
{
      //callback code
}
_______________________________________________
fltk mailing list
fltk@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to