RE: [fltk.general] Making a menu_bar submenu close when the menu_barloses focus

GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.general  ]
Previous Message ]New Message | Reply ]Next Message ]

RE: Making a menu_bar submenu close when the menu_barloses focus "'Philip Rose' via fltk.general" 08:29 Sep 15 top right image

From: Greg Ercolano
Sent: 15 September 2020 16:15
Subject: Re: [fltk.general] Making a menu_bar submenu close when the menu_barloses focus


On 2020-09-15 05:11, '' via fltk.general wrote:

> When I open a top-level sub-menu in my Fl_Menu_Bar I then find that it stays

> dropped down when I move focus away from the menu_bar.


     Sounds like perfectly normal behavior to me.


     I get the same behavior from the menubars for e.g. Firefox on Win7, Linux and Mac

     (just checked) and even Windows 7's own file browser menubar.


     I don't know if Win10 is different.



> Alternaively I would like to generate a system noise alert that window close is being ignored.


     By "window close" do you mean the "X" to close the window, and want to ignore it?

     If so, make a callback for the window (which will be called when the "X" is clicked)

     and invoke whatever Win10 API call is needed to generate the system sound effect,

     then simply return from the callback to prevent the window from closing.


     (If you wanted the window to close, you'd just call e.g. exit(0);)


Thanks Greg, I catch the “X to close” event normally. I am not seeing it as the menu item has the focus. So I don’t think this will help.




You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
Direct Link to Message ]
bottom left image   bottom right image
Previous Message ]New Message | Reply ]Next Message ]

Comments are owned by the poster. All other content is copyright 1998-2020 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to ''.