MainContentComponent::addAndMakeVisible ambiguity

Hi all

I have this code in the MainComponent.h:

class MainContentComponent   : public Component,
                               public ButtonListener,
                               public Slider,
                               public Label
                               
{
public:
    //==============================================================================
    MainContentComponent();
    ~MainContentComponent();
    
    void paint (Graphics&);
    void resized();
    void buttonClicked (Button* buttonThatWasClicked);
    
private:
    //[UserVariables]   -- You can add your own custom variables in this section.
    //[/UserVariables]

    //==============================================================================
    ScopedPointer<TextButton> Button1;
    ScopedPointer<Label> Label1;
    ScopedPointer<Slider> Slider1;

    //==============================================================================
    JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MainContentComponent)
};

 

followed by this code in the MainComponent.cpp

 

MainContentComponent::MainContentComponent()
{
  

    Button1 = new TextButton (T("Nick The Jucer"));
    Label1 = new Label (T("Label 1"), T("Any Text"));
    Slider1 = new Slider (T("Slider 1"));
    
    addAndMakeVisible(Button1);
    Button1->setBounds(10, 10, 50, 20);     // Ορίζουμε την θέση και το μέγεθος του button
   
    addAndMakeVisible(Label1);    
    Label1->setBounds(10, 10, 280, 20);     // Ορίζουμε την θέση και το μέγεθος του button
       
    addAndMakeVisible(Slider1);
    Slider1->setBounds(20, 40, 260, 20);
   
    setSize (500, 400);  
    
    
}

I am receiving the error MainContentComponent::addAndMakeVisible is ambiguous.

Any idea of what is the ambiguity ?

Thanks in advance

 

George

You've inherited your content component from Component, Slider and Label.. That looks pretty broken to me.

BTW, that T("") macro is seriously deprecated, and I'd recommend avoiding it.

Look at that thing in the sky, Is that a slider,?

is that a label?

oh no is a Component !!

... .. 0.o .. ..

 


@Jules

Jules, I had a major problem about identifying the inheritance of classes.
I already solved this problem, by drawing some inheritance diagrams and of cource thanks to the jucebrary site.
So, everything goes better for now...


@sambecket


Thanks for your malevolent style. In my country we have a special classification for your style.