Re: [fltk.general] Which Fl_Menu_Bar submenu is current?

2013-03-02 Thread Albrecht Schlosser
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


Re: [fltk.general] Which Fl_Menu_Bar submenu is current?

2013-03-02 Thread Greg Ercolano
On 03/01/13 15:50, Howard Rubin wrote:
 Hello,
 
 How can I find out which dropdown menu of an Fl_Menu_Bar is currently 
 dropped down (if any)?

Not too familiar with this part of the code,
but looking at the source,
I don't think the API provides a way to do this.

To provide this functionality, I think Fl_Menu would have to be
modified to give you access to the state of shown() method
for the 'menuwindow' class, and walk the 'menustate' array,
both of which are classes internal to Fl_Menu.

___
fltk mailing list
fltk@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk


[fltk.general] Which Fl_Menu_Bar submenu is current?

2013-03-01 Thread Howard Rubin
Hello,

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.

Thanks for any suggestions,
Howard Rubin

___
fltk mailing list
fltk@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk