Notify parent component about child component size change

Hi,
I have a hierarchy of juce::GroupComponents each containing various other juce::Components terminating in an juce::AudioProcessorEditor.
What is the “correct” way of distributing a size change of one of the child components to its parent hierarchy, so that in the end the juce::AudioProcessorEditor can adapt itself to the new size.
Thanks!

There is a method you can overwrite childBoundsChanged.

The component recognizing its size changes calls setSize on itself and you can recalculate the size of all parents (that it may concern) each of them also calling setSize on itself. The chain may break for example at a viewport that always stays at a fixed size, while the viewed component is the last in this chain of childBoundsChanged overwrites.

1 Like

Thanks, that was exactly I was looking for. (And, now reading it I remember having already used it before…) Thanks!