close sub menu on mouse exit

Started by roccio, 02 May 2017, 13:46:15

roccio

Hi,
just wanted to know if there is a way to close a submenu when mouse get out of the menu block.

Thank you

texus

#1
Currently the following hack seems to work:
Code (cpp) Select
menuBar->connect("MouseLeft", [=](){ menuBar->mouseNoLongerDown(); });

I've added a closeMenu function to the github version (which will become 0.7.5 in a few months). With that version you will be able to write the following, which makes slightly more sense:
Code (cpp) Select
menuBar->connect("MouseLeft", [=](){ menuBar->closeMenu(); });

roccio

Thank you very much, the trick works perfectly!

roccio

Hello,
just another question regarding menu.
Is it possible to create a multiple submenu levels or just one menu and one submenu?

Something like

File
--New
-----text file
-----image
--Save
--Exit

texus

Multiple submenu levels is currently not supported.

roccio