ControlP5 scrollableList assign value

I'm working with two scrollableList for project. I want to assign a value, so if I press one of the buttons, it it sends a predetermined value. I want it to operate as a button. Right now I'm using the controlEvent, but I can't distinguish between the two scrollableList.

Anyone who has had the same problem?

Tagged:

Answers

  • you can use Button button; button.id(1); or scrollableList.id(int); this provides an integer as id botton

    void controlEvent(ControlEvent theEvent) { int ID_B = theEvent.controller.id(); println("ID Botton: " +ID_B); }

  • Hi, a working example that highlights the issue would help.

  • I have found a work around from an example in the controlEvent file.

    I'm just using the initiual values from the array, to control with.

    if(theEvent.isFrom(controlP5.getController("String"))){ switch((int) theEvent.getController().getValue()){ case 0: intOutput = 1; break; case 1: intOutput = 2; break;}}

    But thanks for your suggestions.

Sign In or Register to comment.