Export to GitHub

controlp5 - issue #48

Can't change the color of a ListBoxItem


Posted on May 6, 2012 by Happy Rhino

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

Comment #1

Posted on May 6, 2012 by Happy Rhino

Example:

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

Comment #2

Posted on May 15, 2012 by Happy Hippo

Comment deleted

Comment #3

Posted on May 15, 2012 by Happy Rhino

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); }

Comment #4

Posted on May 18, 2012 by Happy Rhino

(No comment was entered for this change.)

Status: Fixed

Labels:
Type-Defect Priority-Medium