Quantcast
Channel: Library Questions - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 2896

ControlP5: ScrollableList getValue()

$
0
0

Hi,

I want to read from my draw() what's the value of the selected item in a ScrollableList object. I don't want to read after changing the item selection. I want to read the selected item from the draw().

That works, but I guess there is a easier way. It's fine with 1 scrollableList, but it doesn't look very nice with 20 scrollableList.

void draw() {

 selectedItem = (int)cp5.get(ScrollableList.class, "myScroll").getValue();
  int filterNameID = (int)cp5.get(ScrollableList.class, "myScroll").getItem(selectedItem).get("value");

}

Any suggestion?

Thanks.


Viewing all articles
Browse latest Browse all 2896

Trending Articles