I’m trying to create a really simple app that has a few different “screens” or “pages” - basic app flow is
- Main page comes up with a few buttons you can click on
- Depending on what button you click, you go to another page
- One of these pages will be fairly CPU-intensive and involve a lot of DSP
What’s the best way to set this up? Here seem to be the five options
- Give the MainWindow one ContentComponent, and give that ContentComponent a few different children, one for each “page.” Just change which one is visible when you click a button.
- Give the MainWindow one ContentComponent. Create several children but give the ContentComponent only one - for every button click, detach the current child and attach the new one and make it visible.
- Give the MainWindow several ContentComponents, and change which one is visible when you click a button.
- Create several ContentComponents but give the MainWindow only one - for every button click, detach the current ContentComponent and attach the new one and make it visible.
- Do any of the above, but instead of just making the children components visible or invisible, actually create and delete them anew each time.
Does anyone have any advice on how is best or the “canonical” way to accomplish this objective? I assume I’ll want to use ApplicationCommandManager, which is fine. My only concern is that I don’t want the CPU-intensive DSP page to keep chugging along if it’s not actually the visible window. Being as I’m new to JUCE, I’m not sure which of the above solutions is most elegant.
Thanks all, your help is muchly appreciated.