-
Colorize rows in a listbox
Hi! I’m trying to color rows in my listbox. I have made it so far that I can color the whole listbox but not the individual rows.
This is the code I’m playing around with that color the listbox itself:
var win = new Window("palette", "New", undefined); //Creates window
var grp = win.add("group");
var listBox = grp.add("listbox", undefined, "MY Listbox", {numberOfColumns: 3, showHeaders: true, columnTitles: ["column1", "column2"]});
var myItems = listBox.add("item","Item1")
myItems.subItems[0].text = "subtest1";
myItems.subItems[1].text = "subtest2";var winGfx = win.graphics;
var black = winGfx.newPen(winGfx.BrushType.SOLID_COLOR, [0,0,0], 1);
var blue = winGfx.newBrush(winGfx.BrushType.SOLID_COLOR, [0,.75,1], 1);
var green = winGfx.newBrush(winGfx.BrushType.SOLID_COLOR, [0,1,0], 1);
var red = winGfx.newBrush(winGfx.BrushType.SOLID_COLOR, [1,0,0], 1);
var yellow = winGfx.newBrush(winGfx.BrushType.SOLID_COLOR, [1,1,0], 1);listBox.graphics.forgroundColor = yellow; //Set window color
win.show();
but how ever I change the code I can’t make it color the individual rows. I hope someone can help me 🙂Thanks!
Sorry, there were no replies found.