Another noob question. Say I have the following object structure:
Application
Other stuff Window
objects... widgets...
That is to say, a tree that branches out from the application object into two smaller trees.
Now I want, events and other stuff that happens in a widget to cause things to happen in the “other stuff” tree. Normally what I’d do is to instantiate the other tree first and then pass an appropriate pointer along with the constructors for the widgets, or something along those lines.
But, as the trees are growing pretty large passing that pointer around is getting messy. So is there a more efficient way of hooking in listeners etc.
I’m considering using a singleton as a sort of registry so that all objects can acquire what they need from there.
Or…It just occurred to me, does JUCE have anything that lets you grab a widget by name? That would probably do the trick.