We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello, i need your help:
i have 4 tabs. And the first and second tab contains many many controllers.
import controlP5.*;
ControlP5 cp5 = new ControlP5(this);
cp5.addTab("tab2");
cp5.addButton("buttonB").moveTo("tab2");
cp5.addButton("buttonC").moveTo("tab2"); //>>problem: moveTo("tab2") appears very often
my idea/wish: to create "cp6" for the many controllers (for tab2) and attach it to the tab2 from cp5.
import controlP5.*;
ControlP5 cp5 = new ControlP5(this);
ControlP5 cp6 = new ControlP5(this);
cp5.addTab("tab2");
cp6.addButton("buttonB");
cp6.addButton("buttonC");
[...]
cp6.moveTo(cp5.getTab("tab2")); //>>but this doesn't work. ..unfortunately
Answers
How is this a problem?
It is not very professional. Besides i have many work.
Do you mean the repetition of similar code? You can apply the same style including moving to another tab via a method. Then you just send controllers through that method to get styled, placed, etc.
Code Example
your code example is little similar to this http://www.sojamo.de/libraries/controlP5/examples/extra/ControlP5style/ControlP5style.pde or not? ;)
..with it, it will be better. (but not perfect for me) B-)
Yes, it is similar indeed (always smart to check out the examples) ;-)
But with that technique you can do a lot more stuff than the little example shows...