I’m trying to analyze the juce demo application right now.
Thereby I do not understand the following:
The method ContentComp::showDemo of the juce looks like this:
void showDemo (Component* demoComp, const char* sourceCodeText)
{
delete currentDemo;
currentDemo = demoComp;
addAndMakeVisible (currentDemo);
resized();
demoSourceCodeText = sourceCodeText;
}
But shouldn’t it be necessairy to call removeChildComponent(currentDemo);
before deleting the child component? E.g.:
void showDemo (Component* demoComp)
{
if (currentDemo)
{
removeChildComponent(currentDemo);
delete currentDemo;
}
currentDemo = demoComp;
addAndMakeVisible (currentDemo);
resized();
}
regards
jan