controlP5: accessing elements after defining in setup()
in
Contributed Library Questions
•
1 years ago
Hello,
I'm using the ControlP5 library to create a GUI for my program. I'm creating all the elements inside setup() like so:
void setup() {
controlP5 = new ControlP5(this);
programlabel = controlP5.addTextlabel("programlabel", "Programs", 350, 65);
Radio programs = controlP5.addRadio("programs",350,80);
programs.deactivateAll();
programs.add("on", 1);
programs.add("off", 2);
programs.add("oscillate", 0);
programs.add("fade", 4);
programs.add("random", 3);
}
What I'd like to do is run programs.deactivateAll(); from another function, triggered by a different controlP5 event.
What's the best way to do this?
Thanks,
Drew
1