The scenario is this, the mouse is over a button, the button state changes to buttonOver in Juce code, when my own code detects the state change it loads up a popup menu. (You can imagine the intent, mouse goes over button, pop up menu displays, mouse moves away, popup menu disappears). The only problem is as the popupmenu displays, it must be taking the focus away from the button as temporarily the buttonstate will change to buttonNormal, I’d like to make use of that state change to detect when the mouse is genuinely not over it and close the popup menu. As things are the popup menu blinks in and out of existence. I can probably make do by using the mouse directly but I’d like to keep things neat and tidy.
Long question cut short, how do I tell a button to keep hold of the mouse focus regardless of popup menu displaying?
Edit: Come to think of it, this is expected, the popup menu functions by knowing it has focus, and when it doesn’t, it will close itself. I ended up simply subscribing to desktop mouse notifications, I also sent through my own callback object to know for sure when the menu weren’t active. I found it a little weird that the popup menu code deleted that object, I would have preferred if it were simply an interface so my parent object could simply be notified. But it works now.