Controlp5 tabs and Textarea
in
Contributed Library Questions
•
1 year ago
Hello,
I mixed up couple sketches to learn more about tabs in controlP5. In this example I need to put text to second tab, but line 40 gives me an error. what wrong I am doing ?
thanks for help.
- import controlP5.*;
- ControlP5 cp5;
- Textarea myTextarea;
- void setup() {
- size(700, 400);
- cp5 = new ControlP5(this);
- cp5.addTab("extra")
- .setColorBackground(color(0, 160, 100))
- .setColorLabel(color(255))
- .setColorActive(color(255, 128, 0))
- ;
- cp5.getTab("default")
- .activateEvent(true)
- .setLabel("first tab")
- .setId(1)
- ;
- cp5.getTab("extra")
- .setLabel("Second tab")
- .activateEvent(true)
- .setId(2)
- ;
- myTextarea = cp5.addTextarea("text")
- .setPosition(100, 100)
- .setSize(200, 200)
- .setText("some text to show in second tab")
- ;
- cp5.getController("text").moveTo("second tab");// ERROR
- }
- void draw() {
- background(0);
- }
1