How do I attachToComponent a label below a slider? The option in the method just gives me left or top, but I think I might be missing something, since below a slider seems to be a very common labeling convention, split about 50/50 with top (at least in the hardware synths I have in my studio right now)?
I’d recommend not relying too heavily on these sorts of APIs with widgets - you’ll almost always get more flexibility by creating your own custom components.
It looks like
juce::Label::attachToComponent is used in a few places in the codebase by other JUCE components, so it’s likely it was only added to suit the needs of those other components.
You could create a simple
LabeledComponent that can be given a component and puts a label below it. It also removes the need for you to manage a label and the corresponding component, you can just manage the one component which will make your code simpler and cleaner.
Thanks, I was thinking about doing that but I was hoping it would be common enough that someone would’ve done it already