How can I change the MainComponent in mainwindow?


#1

HI all,

I am searching for this for hours but nothing found..

Basically, how can I get a reference or a pointer for the mainWindow when I am inside the MainContentComponent ?

Thanks in advance

 

George


#2

Ask for the topLevelComponent: https://www.juce.com/doc/classComponent#ae0f9f275a8a0d09acbf789c0aaa86314

You can check via dynamic_cast if it is a MainWindow. See the docs about the possible outcomes...

HTH


#3

Also, Component::findParentComponentOfClass


#4

Thanks guys..