I’ll fully admit to an attack of the stupids, but I’m trying to understand the AlertWindow class. Here’s some example code:
[code] pAlertWindow = new AlertWindow(T(“Alert”), T(“Run for your life!”), AlertWindow::NoIcon);
pAlertWindow->addButton(T(“OK”), 0);
// Very ugly colors here
pAlertWindow->setColour(AlertWindow::backgroundColourId, Colour::Colour(0xff404040));
pAlertWindow->setColour(AlertWindow::textColourId, Colour::Colour(0xffff8080));
pAlertWindow->setColour(AlertWindow::outlineColourId, Colour::Colour(0xff000000));
// addChildComponent(pAlertWindow);
pAlertWindow->runModalLoop();
pAlertWindow->setVisible(false);
[/code]
First of all, this is the main editor component for an audio plugin. Second, I’m running the 1.46 version of Juce. I have two questions related to this code
[list]If I add the alert window as a child component (by uncommenting it), it doesn’t seem to appear anywhere on my screen. In addtion, I can’t seem to attract its attention (it never exits the loop), so I have to halt the parent application. BTW, calling toFront doesn’t seem to make any difference.
The call to ‘runModalLoop’ makes the alert visible, but I seem to have to manually turn off visibility after the loop exits. I thought this was taken care of by the loop exit code.[/list]
I’m trying to attach this thing as a child component so that it will appear in the vicinity of the plugin window. Have I got my head wrapped around this wrong? Thanks for any nudges in the right direction.