> Hello experts!
> 
> A part of my program consists of a window wherein there are some buttons and 
> a MenuBar with some Items.
> 
> I have to overload the draw-methode of all my widgets, so that I can use 
> images to draw these widgets.
> My problem now is, that I can`t use the fltk::belowmouse()-methode inside the 
> draw-methode of the Items which are part of a MenuBar. The methode returns a 
> pointer to the window, not to the Item which is below the mouse ...
> Inside the draw-methode of the buttons I can use this methode! The returned 
> pointer is correct.
> 
> Is this a normal behavior, or did I sth wrong?
> 
> Till now I checked whether the fltk::HIGHLIGHT flag is false or true, to 
> verify whether the Item is below the mouse or not, but I had to notice now 
> that this flag isn`t correct at any time, too ...
> 
> I hope you can help me!

Hi,

fltk::belowmouse() will fail if you don't propagate events to
widget/group that is calling it. I'm assuming you call it from Window,
but actually you should use it inside MenuBar. 

To explain: when you open menu, all events will go to it and it's 
children, including fltk::ENTER (if you peek inside fltk::belowmouse() 
documentation, 
you will see "This is the last widget to respond to an fltk::ENTER event 
as long as the mouse is still pointing at it."); Window or MenuBar
parent, in the mean time does not receive anything.

I'm assuming you are trying to get some effect when mouse entered Item;
I would advise handling that part from handle() like it was done for
highlighting. You can check highlighting sample from MenuBar code :)

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

Reply via email to