I’m trying to implement a custom look and feel for a rotary slider using MS Visual Studio 2015 and Projucer Version 4.3.1. This slider appears to function properly but I get the following exception upon closing my application:
Exception thrown: read access violation.
juce::Component::getLookAndFeel(…). was 0xDDDDDDDD
I’m attempting to override only the “drawRotarySlider()” method the same way it’s done in the “LookAndFeelDemp.cpp” demo as follows:
//---------------------------------------------------------------------------------------------
struct CustomLookAndFeel : public LookAndFeel_V3
{
void drawRotarySlider (Graphics& g, int x, int y, int width, int height, float sliderPos,
float rotaryStartAngle, float rotaryEndAngle, Slider& slider) override
{
’
’ (same as in demo)
’
}
}
//---------------------------------------------------------------------------------------------
In my main component I’m adding my custom look & feel in the same way the demo does it:
//---------------------------------------------------------------------------------------------
CustomLookAndFeel* claf = new CustomLookAndFeel();
lookAndFeels.add (claf);
setLookAndFeel(claf) ;
//---------------------------------------------------------------------------------------------
and defining
//---------------------------------------------------------------------------------------------
OwnedArray lookAndFeels;
//---------------------------------------------------------------------------------------------
Apparently, I’m missing something.