Alert window does not receive button callbacks


#1

Hello,

I’m trying to display an alert window when our plugin is loaded. It is called in the main entry point of the plugin. That is…in the entry point we call a library function, which in turn displays an alert window. I should note that our plugin does not derive from a JUCE class, I am only using the JUCE library for the nuts and bolts classes (String, AlertWindow, etc.). The problem is on the Mac clicking the buttons does not trigger any response. The window itself is getting mouse events, because I can click and drag the alert window around. I found this forum post, which says that modal loops in the plugin constructor are generally a no-no:

http://rawmaterialsoftware.com/viewtopic.php?f=8&t=5967&hilit=mouse+event

BUT, I’m not able to reproduce this problem with the Juce demo plugin on Mac, nor am I able to reproduce the problem with our plugin in Windows, so I’m inclined to believe that it should work. Is there any way to get this to work on the Mac for our plugin?


#2

Only show your UI after the plugin’s editor has been opened, and preferably embed it in inside your plugin’s editor rather than opening a new window.

Trying to pop up a UI before the user has actually opened the plugin’s UI is a bad idea on many levels. It’ll fail because of host-specific threading weirdnesses. And even on hosts where it does work, it’ll annoy the hell out of people and make you look unprofessional when it pops up during a plugin-scan!

More here:
http://www.rawmaterialsoftware.com/viewtopic.php?f=8&t=5967


#3

Hi Jules,

Thanks for the response. Unfortunately, the alert window is part of the copy protection check, which in our case must happen before the plugin’s window and UI can be fully constructed. I guess I’ll have to think about some alternative approaches.


#4

It’s all a bit of a pain, but as I’ve ranted on other threads, there are some hosts where it’s just completely impossible to do anything involving messages or UI before the editor has been opened - you’ll just have to make the audio silent or something if your copy protection fails…