TextButton Text Color Mystery

Hi all,

I’ve updated to the latest Juce tip. For some reason, the following TextButton code generates text that is the proper shade of red on OS X, but shows up as black on Windows:

addAndMakeVisible (presetsSelect = new TextButton (T("presetsSelect"))); presetsSelect->setLookAndFeel(juceLook); presetsSelect->setButtonText (getFilter()->getCurrentPresetName()); presetsSelect->setColour (TextButton::buttonColourId, Colour (0x00797979)); presetsSelect->setColour (TextButton::buttonOnColourId, Colour (0x00797979)); presetsSelect->setColour (TextButton::textColourOnId, Colour (0xffff460e)); presetsSelect->setColour (TextButton::textColourOffId, Colour (0xffff460e)); presetsSelect->setTooltip(T("PRESETS: allows the user to save and recall plugin settings")); presetsSelect->addListener (this);

The text shows up in the proper embedded typeface, but in a smaller font size than the other TextButtons (which seem to be working properly).

Any idea what might be going on here?


Sean Costello

0x00797979 would be transparent, you know?

Yes. I just want the button to show up as a red word. But it is showing up as a BLACK word.


Well, I honestly don’t know… Mac + PC use identical code for this kind of thing so you shouldn’t see any differences between them. Maybe try tracing it through the paint routine and see what happens?

Figured it out. I had a different date on the LookAndFeel code between the Mac and PC. The older LookAndFeel code had the text color preset to black - it was obviously a work in progress, that accidentally got moved over to the PC in the last few days. :oops: