Why not to put childs inside DocumentWindow?

Hello,
In my application, my main class is
class MainComponent : public juce::AudioAppComponent, public juce::Slider::Listener, public juce::ComboBox::Listener, public juce::TextButton::Listener, public juce::TextEditor::Listener

and inside this class,

I created a DocumentWindow as follows

juce::DocumentWindow* buttonwindow

and in that buttonwindow,
I put TextButtons, Sliders, ComboBoxes etc

But in the JUCE document, it is said
don’t this this

Instead, it says, create a component inside that buttonwindow

Then, what is the use case of DocumentWindow (without putting childs inside directly)?
I really wonder

===========================-------------------==============

Also, there is another question,
the JUCE document also says,
do not resize the DocumentWindow

What is the reason for this?

Thanks

The documentation indicates that the operation of DocumentWindow can be broken if you override certain Component member functions, and do not call the super-class versions of these. So, to mitigate that problem, the recommedation is made to not add child Components.

(If for some obscure reason you do need to override these methods, always remember to call the super-class’s resized() method too, otherwise it’ll fail to lay out the window decorations correctly).

1 Like

Hello, Thank you. I understand now
Have a great day and see you.