On 02.03.2013 00:50, Howard Rubin wrote:
How can I find out which dropdown menu of an Fl_Menu_Bar is currently
dropped down (if any)?
I need to know this in an add_timeout()/repeat_timeout() timer.
I don't know if there is a way to do it, and I'm afraid there is no
official/documented way to do this. Also, please take care not to
open or modify windows while a menu is open. This can yield unwanted
effects, since the open menu window does a grab(), so that mouse
events can be captured. This can result in the program appearing to
hang. Although this has been fixed at least partially, there can still
be some bad effects. See http://www.fltk.org/str.php?L1986
That said, I'd try if mvalue() is of some help for you. It returns
the last menu item that was picked(), and I assume this is or can
be the (parent ?) item that has been clicked to open the currently
open menu item/window. However, I'm not at all sure about this, and
you'd have to check if this is also usable if only the top level
menu item has been opened, and also if this is really reset when
the menu is dismissed - I don't know, but this is the best help I
can give.
Another way could be to use a callback that will be called when
a menu is selected, but again I'm not sure if this will help.
You'd probably have to track the open menu(s) yourself, and I also
don't know if you'd get a callback when the menu gets closed.
HTH
Albrecht
___
fltk mailing list
fltk@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk