// --8<-------8<-------8<-------8<-------8<-------8<-------8<-------8<-------8<-----
// ```
ControlP5 cp5;
final static String BUTTON_START="buttonStart";
void initForm()
{
cp5 = new ControlP5(this);
// cp5.setVisible(true);
PImage[] imgs = {loadImage(PATH+PATH_BUTTON+BUTTON_START+RELEASED+".png"), loadImage(PATH+PATH_BUTTON+BUTTON_START+OVER+".png"), loadImage(PATH+PATH_BUTTON+BUTTON_START+PRESSED+".png")};
cp5.addButton("start")
.setValue(128)
.setPosition(140, 300)
.setImages(imgs)
.updateSize()
;
}
public void start(int theValue) {
println("a button event from buttonB: "+theValue);
// exit();
}
// --8<-------8<-------8<-------8<-------8<-------8<-------8<-------8<-------8<-----
// the draw() routine is empty
void draw()
{
}
It works but the function public void start(int theValue) is called even if the mouse is not clicked over the relative button.
Do you have any similar problem ? How do you fix it ?
Thank you very much for cooperation
regards