ControlP5 listboxitem question
in
Contributed Library Questions
•
2 years ago
I'm trying to change the colour of a listbox item when it is selected but it only seems to change when I drag the scroll bar attached to the listbox.
The following is some code to illustrate my point:
// In initialisation
colourSelectList= controlP5.addListBox("Colour",660,335,150,20);
colourSelectList.setColorActive(color(0,255,255));
colourSelectList.setItemHeight(20);
colourSelectList.setBarHeight(20);
colourSelectList.setHeight(150);
ListBoxItem item1=colourSelectList.addItem(item1Name,item1Identifier);
// Later on in the program
item1.setColorBackground(color(255,0,255));
1