controlp5
controlp5 copied to clipboard
keep Scrollable list open
Is there any way to keep the Scrollable list open after selecting/clicking on a item?
The source code for ScrollableList shows that it uses the setOpen() function to close the list after an item is selected (triggered by onRelease()). To counter that, I used a CallbackListener to detect when an item is selected and forced the list to stay open.
ControlP5 cp5 = new ControlP5(this);
ScrollableList list = cp5.addScrollableList("list").addItems(new String[] {"a", "b", "c"});
list.onRelease(new CallbackListener() {
public void controlEvent(CallbackEvent theEvent) {
list.setOpen(true);
}
});