Hi everyone.
I've been having some problems with ControlP5 library, and i'm unable to find any "easy" soluction.
My problem is that every time i set a value to a button (and probably any other simple interface) fires an event. That means that every time i do button.setvalue( value ), i get the same event as the button was pressed.
This is a very big problem for me, because that's the last thing i want to happen on the situation i have on my program.
My question is:
Is it possible to change the button value without triggering the event?
Here goes a small bit of code that shows exactly my problem.
Code:import controlP5.*;
ControlP5 controlP5;
controlP5.Button bb;
int myColorBackground = color(0,0,0);
int buttonValue = 1;
void setup() {
size(100,100);
controlP5 = new ControlP5(this);
bb = controlP5.addButton("button",10,10,10,80,20);
bb.setId(1);
}
void draw() {
background(buttonValue*10);
bb.setValue(0);
}
void controlEvent(ControlEvent theEvent) {
println(theEvent.controller().id());
}
void button(float theValue) {
println("a button event. "+theValue);
}