oulaoups / controlp5

Automatically exported from code.google.com/p/controlp5
0 stars 0 forks source link

Can't change the color of a ListBoxItem #48

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a ListBox by addItem(String, index) method
2. Call getItem().setColorBackground() method of the list to try to change the 
color of the background of the ListBoxItem.

What is the expected output? What do you see instead?
Trying to change the color or text of the ListBoxItem doesn't change anything

What version of the product are you using? On what operating system?
0.7.2, windows 7

Original issue reported on code.google.com by matilla....@gmail.com on 6 May 2012 at 5:12

GoogleCodeExporter commented 9 years ago
Example:

ListBox myList = controlP5.addListBox("myList", 100, 100, 100, 20);
myList.addItem(item1, 0);
myList.getItem(0).setColorBackground(color(255,0,0));

Original comment by matilla....@gmail.com on 6 May 2012 at 5:15

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
this works for me with version 0.7.2 and above

import controlP5.*;
ControlP5 cp5;

void setup() {
  size(300, 350);
  cp5 = new ControlP5(this);
  ListBox myList = cp5.addListBox("myList", 100, 100, 100, 120);
  for(int i=0;i<100;i++) {
  myList.addItem("item"+i, 0);
  }
  myList.getItem(0).setColorBackground(color(255,0,0));
}

void draw() {
  background(0);
}

Original comment by soj...@gmail.com on 15 May 2012 at 12:13

GoogleCodeExporter commented 9 years ago

Original comment by soj...@gmail.com on 18 May 2012 at 5:07