CalloutBox dismissal inside plugin

When used inside a plugin, calloutboxes do not appear to be dismissed by events that happen outside of the plugin window area. Therefore - If I drag the plugin titlebar while the calloutbox is open, the calloutbox stays stuck in the same poisition on the screen, until a mouse event inside the actual plugin window area closes it.

This also means that if you swap the plugin in the channel strip, or delete the channel completely (whilst the calloutbox is open), it causes the DAW to crash. Presumably the DAW gets confused by the hanging calloutbox window, after it's parent plugin has been removed.

I have noticed that the popupmenus in my project exhibit the behaviour I would like for my calloutbox: when the mouse is clicked anywhere on screen, the popup disappears. I think it would probably make sense for calloutboxes to exhibit the same dissmissal behaviour the as popupmenus.

Does anyone have any advice on how I can get the desired calloutbox behaviour? I have subclassed calloutbox already so can make changes to the component in there.

Thanks in advance

DTT

 

Yep. Unfortunately it's very tricky for the plugin to capture those other events, because they're sent to the host's windows, not to ours. If you do find any tricks that may help with this which aren't horrificly dangerous hacks, then please let me know!

Thanks for the quick reply. Ok, that's a shame but... I am wandering, if it's possible for popupmenus to have the correct dismissal behaviour then it should be fine for calloutboxes too?

My plan of action will be to see how the events are captured for popupmenu dismissal, then to reproduce that for my overridden calloutbox.

Yes.. that's sensible logic.. Maybe there is something simple that could be done then!

 if it's possible for popupmenus to have the correct dismissal behaviour then it should be fine for calloutboxes too?

I'm not sure about that.... I think that the CallOutBox would be dismissed as soon as you click, but you obviously don't always want your call outbox to be closed when you click in it!

Some kind of fix / compromise was just to use a popupmenu with a custom item, instead of a calloutbox. Then in the inherited popupmenu class, just remove the line of code that makes it disappear when you click on it. This gives the correct behaviour, (but not calloutbox arrow / bordering options unfortunately).