On 9 Feb 2013, at 00:06, Howard Rubin wrote:

> In this program, I've derived from Fl_Menu_Bar and overridden the 
> handle(int) function. That's because I need the submenu to pop up when 
> the mouse enters the the menu, without the user having to press a mouse 
> button.

I'm not really clear on what you are trying to achieve, but I do wonder if you 
might be better deriving your own menu bar class form Fl_Menu_ rather than 
trying to prod Fl_Menu_Bar to do what you need.
If you are going "too far" beyond what it normally does, that might actually be 
easier.
Or... maybe you can cobble something together by putting menu_buttons into a 
group (rather than menus in a menu_bar) and (somehow) use that to get the 
desired effect?


> 
> It seems that pulldown() doesn't return until I press Esc, and 
> handle(FL_LEAVE) doesn't get called until then.
> 
> Thinking of my Fl_Menu_Bar derived class and its submenus as a unit, I 
> need to somehow detect as soon as the mouse cursor enters or leaves that 
> unit, without requiring a keyboard press or mouse click.

Yes..

One thing that occurs to me is that, in your derived handle() method, you 
probably need to be sure and call the base class method in every case, as it 
may be propagating actions to subsidiary widgets and so forth.

So I generally call it first, and then do any specific "extra" actions locally. 
And return the appropriate value, of course.
Oh, and having returned non-zero for the ENTER event you need to also return 
non-zero for the LEAVE event to make things balanece. I think...

Though I have no idea if any of that is pertinent in this case or not!




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

Reply via email to