Michael Schmid wrote:
> Hi!
> 
> How can I find out with below_mouse(), if there is a spesific widget 
> under the mouse? I didn't find any examples and also don't understand 
> how to use it exactly...
> 
> Could anyone post some code :-) I need it in the form:
> 
> if(mouse under a specific widget)
> {
> ...
> }

The normal FLTK way is something like "the other way around". A widget that 
gets 
an FL_ENTER event must return 1 on this event in its handle() method to become 
the Fl::belowmouse() widget. Then it will also get FL_MOVE and FL_LEAVE events. 
Maybe this is all you need.

Fl::belowmouse() will tell you, which widget is the current "belowmouse" widget 
(but this can also be NULL). But this will only work, if your widget's event 
handling does, what I described above.

If you want to know, which widget is currently under the mouse pointer at any 
given time, then you would need to walk the widget tree yourself and check 
every 
widget (group) recursively (or you need a table of all relevant widgets for 
this 
check).

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

Reply via email to