setContentComponent questions

  1. If i have a VST window and a content component (tabbed component) now one of the tabs is a DocumentWindow, do i have to set this document windows another contentComponent, what i’m asking is if each (no matter how far down the component line) documentwindow has to have a content component?

  2. if i have a documentWindow what to set it’s content component (witch class), to make adding new children as simple as possible, like i wrote in pt.1, i a have a DocumentWindow, this window has to hold knobs/sliders/buttons, as far as i’m concerned i just want to add them to the window, but you write i should make one component THE content component for this window, what to choose and why, i wouldn’t want to write my own Component derived class cause i don’t really know how (and if i’ll have to i’ll propably will learn how, but that’s just more bugs in the code for me).

anyway could you in simplest terms explain how to do this safe and simple?
i got lost with this issue somewhere along the road.


writing your own component is important for the document window, and it is indeed what you need to do; you ought to be aware though, that the exact same steps needed to create your own Component are what you’d have to do to add Components to a DocumentWindow. There wouldn’t be any easier way of doing it just by building them into the DocumentWindow.

Also, what do you mean one of the tabs is a DocumentWindow? A tab holds a Component, a DocumentWindow is a floating window that you can move around. There’s no reason you’d have a tab as a floating window, as they’re two different concepts.


well to tell you the truth i dont know if i get the concept of those “content component” bits. what i do is:

tabComponent->addTab ("Panel", Colours::white, panel, false, 2);

where the panel is a DocumentWindow class.

perhaps i’m wrong but how do i go about adding some knobs/faders (anything) to a tab (and treat a tab as a window with a background and all).


your panel should not be a documentWindow descendent.

Inherit from Component.