ControlP5 controlEvent
in
Contributed Library Questions
•
11 months ago
Having an issue with a control Event with control P5. I'm using a radio button and am trying to capture the event specific to that but it seems like I can only capture the event class but access any methods. Heres some of my code :
- swatchButtons = cp5.addRadioButton("Swatch Select", 20, 120);
- swatchButtons.setItemWidth(20);
- swatchButtons.setItemHeight(20);
- swatchButtons.setColorForeground(color(120));
- swatchButtons.setColorActive(color(255));
- swatchButtons.setColorLabel(color(255));
- swatchButtons.setItemsPerRow(5);
- swatchButtons.setSpacingColumn(15);
- for (int i = 0; i<swatches.length; i++) {
- swatchButtons.addItem(swatches[i].id, i);
- }
- swatchButtons.addItem("None", -1);
- public void controlEvent(ControlEvent theEvent) {
- println(theEvent.isFrom(swatchButtons));
- }
That won't even compile because it says the function isFrom() doesn't exist. And I checked the Javadoc to make sure. Any Ideas?
Thanks!
1