Re: [fltk.general] Making a menu_bar submenu close when the menu_bar loses 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_bar loses focus Greg Ercolano 08:15 Sep 15 top right image
 
On 2020-09-15 05:11, 'pvr...@btinternet.com' 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);)

-- 
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 fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/8f150d46-1d15-acd9-f881-2bce7042c64d%40seriss.com.
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 'erco@seriss.com'.