OfxGUI dynamic during runtime


I’m trying to change the content of an ofxpanel during the runtime (for example adding button and removing sliders after clicking on a ofxbutton) and i don’t succeed to do that, anyone can help me or give me a small example ?

Cheers !!


After digging, i succeed to have a dynamic ofxGUI panel, but i noticed a strange behavior with the ofxButton. For exemple if i created an ofxButton with setup() and added a listener to this button, if i relaunch setup() the callback function i pass to the listener is then call. So i assume that i need to remove the listener before calling again setup(), but i don’t understand why : what trigger the listener when i call setup() ?

Nobody have an idea about this behavior ?