I’m been making some buttons in Jucer and running into the weirdest bug. If the button’s member name and text are the same, Jucer doesn’t create a set button name method. Later, when my custom button sub-class calls the LookAndFeel get button text function to draw the text, it comes up blank.
Amazed this hasn’t come up before - it must be just this set of circumstances.
But if the names are the same, it doesn’t need to call setButtonText - the text is set by the constructor (?) Are you overriding setButtonText or something?
//==============================================================================
//[UserMethods] -- You can add your own custom methods in this section.
void reallyPaintButton (Graphics& g, bool isMouseOverButton, bool isButtonDown);
void setColorAndIcon (juce::Drawable* newIcon, const Colour& newColor, const Colour& offColor = Colour (0xe0333333));
//[/UserMethods]
void resized();
void paintButton (Graphics& g, bool isMouseOverButton, bool isButtonDown);
//==============================================================================
juce_UseDebuggingNewOperator
private:
//[UserVariables] – You can add your own custom variables in this section.
Colour buttonColor;
Colour offColor;
juce::Drawable* buttonIcon;
//[/UserVariables]
//==============================================================================
//==============================================================================
// (prevent copy constructor and operator= being generated..)
MeshPanelButton (const MeshPanelButton&);
const MeshPanelButton& operator= (const MeshPanelButton&);