# Alert window does not receive button callbacks

**URL:** <https://forum.juce.com/t/alert-window-does-not-receive-button-callbacks/5758>\
**Category:** General JUCE discussion\
**Created:** [October 11, 2010, 11:29pm UTC](https://forum.juce.com/t/alert-window-does-not-receive-button-callbacks/5758 "2010-10-11T23:29:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dans](https://avatars.discourse-cdn.com/v4/letter/d/7993a0/32.png) [@dans](https://forum.juce.com/u/dans)\
**Post date:** [October 11, 2010, 11:29pm UTC](https://forum.juce.com/t/alert-window-does-not-receive-button-callbacks/5758/1 "2010-10-11T23:29:39Z")

</div>

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](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?

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [October 12, 2010, 7:56am UTC](https://forum.juce.com/t/alert-window-does-not-receive-button-callbacks/5758/2 "2010-10-12T07:56:55Z")

</div>

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](http://www.rawmaterialsoftware.com/viewtopic.php?f=8&t=5967)

---

<div class="post-metadata">

**Author:** ![dans](https://avatars.discourse-cdn.com/v4/letter/d/7993a0/32.png) [@dans](https://forum.juce.com/u/dans)\
**Post date:** [October 12, 2010, 5:25pm UTC](https://forum.juce.com/t/alert-window-does-not-receive-button-callbacks/5758/3 "2010-10-12T17:25:10Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [October 12, 2010, 6:33pm UTC](https://forum.juce.com/t/alert-window-does-not-receive-button-callbacks/5758/4 "2010-10-12T18:33:31Z")

</div>

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…
