Hi there.
I am using JUCE Grids to arrange many GUI items. Currently I am doing so by manually typing in each item, such as with the following:
frequencyEditorGrid.items = { juce::GridItem (voiceFrequencyBoxes[0]), juce::GridItem (voiceFrequencyBoxes[1]), juce::GridItem (voiceFrequencyBoxes[2]), juce::GridItem (voiceFrequencyBoxes[3]), juce::GridItem (voiceFrequencyBoxes[4]), juce::GridItem (voiceFrequencyBoxes[5]), juce::GridItem (voiceFrequencyBoxes[6]), juce::GridItem (voiceFrequencyBoxes[7]), juce::GridItem (voiceFrequencyBoxes[8]), juce::GridItem (voiceFrequencyBoxes[9]), juce::GridItem (voiceFrequencyBoxes[10]), juce::GridItem (voiceFrequencyBoxes[11]), juce::GridItem (voiceFrequencyBoxes[12]), juce::GridItem (voiceFrequencyBoxes[13]), juce::GridItem (voiceFrequencyBoxes[14]), juce::GridItem (voiceFrequencyBoxes[15]) };
However, I don’t like this for a few reasons- it’s tedious, it clutters code, and it requires the magic number of voiceFrequencyBoxes pasted in, which is annoying if I change the amount later. I’d prefer to just iterate over my voiceFrequencyBoxes array, adding them as items to the Grid- but I can’t seem to figure out the syntax for doing so.
Is it possible? What would the syntax be? Thank you!
