How to draw multiple ofxPanels with ofParameter

I want classes which have ofParameters to have there own panels. Right now I create groups and add those to one panel which get long.

I thought it would be easy as to declare multiple ofxPanels in ofApp or in the class self, but it doesn’t work.

The panels are being used with ofParameter. Below is a example a how I now use it.

.h

ofxPanel gui;
ofParameterGroup parameterGroup;
ofParameterGroup globalGroup;
ofParameter<float> scale, rotate, background;
MatrixPattern matrixPattern;

.cpp

//adding scale, rotate, background to globalGroup
parameterGroup.add(globalGroup);	
parameterGroup.add(matrixPattern.matrixParameters);
gui.setup(parameterGroup);

you should create multiple panels and ad groups to the desired ones :

ofxPanel gui1;
ofxPanel gui2;

gui1.setup();
gui1.add(parameterGroup1);

gui2.setup();
gui2.add(parameterGroup2);
gui2.setPosition(x, y); // sets position to avoid overlaping

The problem was where I was calling ofxPanel.draw(). I didn’t call the second gui in de ofApp but in the MatrixPattern class itself. It is working now. Thanks for the reply