Alvin wrote:
>> I think Greg had a demo for this... Erm, maybe this one?
>> http://www.seriss.com/people/erco/fltk/#DrawCoords
> 
> After posting my question I went straight to Greg's page. His example does
> work, except I cannot see why my widget isn't receiving the FL_MOVE event.

        Most likely reason is in order to receive FL_MOVE, you have
        to return(1) in response to FL_ENTER. From the docs on "Handling 
Events":

FL_ENTER
The mouse has been moved to point at this widget.
This can be used for highlighting feedback.
If a widget wants to highlight or otherwise track the mouse,
it indicates this by returning non-zero from its handle() method.
It then becomes the Fl::belowmouse() widget and will receive FL_MOVE and 
FL_LEAVE events.

        In my example it works because Fl_Group (the widget I'm deriving from)
        does this already.

        The reason FL_MOVE is not sent by default is to decrease 'event 
traffic',
        since passing every mouse movement down the widget hierarchy would
        be a lot of unnecessary cpu spinning if the widgets don't need it.
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to