Is there a way of getting the individual id of scrollable list in controlP5 while hovering? In the sketch below you get the id by clicking. Possible to get it by hovering?
import controlP5.*;
import java.util.*;
//String info;
ControlP5 cp5;
void setup() {
size(400, 400);
cp5 = new ControlP5(this);
List l = Arrays.asList("a", "b", "c", "d", "e", "f", "g", "h");
cp5.addScrollableList("dropdown")
.setPosition(100, 100)
.setSize(200, 100)
.setBarHeight(20)
.setItemHeight(20)
.addItems(l)
.setType(ScrollableList.LIST) // currently supported DROPDOWN and LIST
.onMove(new CallbackListener() {
public void controlEvent(CallbackEvent theEvent) {
float value = theEvent.getController().getValue();
println("the value is " + value);
}
}
);
}
void draw() {
background(240);
// HOVER
boolean over = cp5.get(ScrollableList.class, "dropdown").isMouseOver();
// println("OVER " + over);
}
void dropdown(int n) {
println("id:" + n);
}