I have a TabbedComponet object with 3 tabs.
Tabs hold 16 meters each, with label id on each meter.
Inside TC constructor I add pages as follows:
addTab (T("Meters 1-16"), Colours::gainsboro, createMetersPage(filter,16,0), true);
addTab (T("Meters 17-32"),Colours::gainsboro, createMetersPage(filter,16,16), true);
where createMetersPage is a method that returns a new page.
Component* createMetersPage(XRPFilter& filter, const int howMany, const int firstIs)
{
XRPPageComp* page = new XRPPageComp();
for (int i = 0; i < howMany; ++i)
{
XRPMeter* meter = new XRPMeter();
const int xpos = 10+(i*30);
meter->setBounds(xpos, 10, 20, 192);
meter->setChannel(i+firstIs);
filter.Peak(i).addChangeListener(meter);
Label* pLabel = new Label(T("metlabel") + String(i), String(i+1));
pLabel->setBounds(xpos,210,18,16);
page->addAndMakeVisible(pLabel);
page->addAndMakeVisible(meter);
}
return page;
}
The results is that the two tabs are identical, the second is equal to the first.
I can’t understand why, I’ve tried to remose static declaration for createMetersPage but without success.
Many thanx in advance for your precious suggestions!