AlertWindow text issue

Looks like something is wrong in AlertWindow?

I hadn’t noticed this issue until just now, so I suspect its related to some recent changes (I’m at 6.14, on mac).

You will notice there is a period added in the second set of text, so maybe the Title / Description is being added to a child textEditor object?

Could be something I did, of course, but I should note that I’m not overriding the AlertWindow LookAndFeel methods or anything like that, so I’m not sure what could cause this sort of issue.

juce::AlertWindow::showMessageBoxAsync(juce::AlertWindow::WarningIcon, "Test", "Well, this is strange");

Screen Shot 2022-01-03 at 2.35.43 PM

Ah, ok, looks like this is the accessibleText. Am I doing something that causes it to show up though, or is this a bug?

Are you overriding the Label look and feel methods? The constructor of the AlertWindow should set all of the label colours to transparent black, but if a custom look and feel were to use a custom colour instead of Label::textColourId then maybe that could cause the text to show up.

Ah, that’s probably it then.

I wish there were a solution that let me keep my custom label methods intact, but I guess it’s just better practice to use the provided color ids.

Still, if the intention is to not have this component be visible, why not just setVisible instead of changing the colors?

I’d have to dig into the code to be sure, but my guess is that setVisible (false) would also make the label inaccessible to screen readers.

1 Like

Aha! Makes sense. Ok, thanks for the guidance :slight_smile: