Popup Menu - Callback


#1

Jules - it'd be great if PopupMenu::showAt could get a C++11 lamda version. 

I'd like to write: 

menu.showAt(this, [this](int result) { doSomethingWith(result); }); 

Maybe I'm doing it wrong but ModalComponentManager::Callback feels a bit faffy, and I can never remember the syntax!

 


#2

Yep, good request - that's a good place for lambdas.

We want to start adding more use of lambdas now, even though they'll still have to be guarded by annoying JUCE_COMPILER_SUPPORTS_LAMBDAS


#3

Great, I've been using lamdba's in my code recently, adds lots of flexibility especially with modal inputs.