Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Colorize rows in a listbox

  • Colorize rows in a listbox

    Posted by Jacob Danell on April 30, 2014 at 4:23 pm

    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!

    Jacob Danell replied 12 years, 3 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy