multi-column listbox

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
kingkai
Posts: 3
Joined: July 19th, 2006, 9:49 am
Location: Seattle

How can I add items to multi-column listbox and its headers?

All I see in CS4 changes is how to change the number of columns and showing headers.

thank you.
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

I think you need to define column headers using the creation properties when you create the listbox. Here's an example using a resource specification string:

Code: Select all

myListbox: ListBox { alignment:['fill','fill'], properties:{multiselect:true, numberOfColumns:14, showHeaders:true, columnTitles: ['','','','','Composition','#','Font','Size','Fill/Stroke','Stroke','Fill Color','Stroke Color','Alignment','Text']} }, \
Then to add an item you can use something like:

Code: Select all

var myItem = myPalette.myListbox.add ('item', 'this text will appear in column 1');
To change the text on the first item you can use:

Code: Select all

myItem.text = "text in column 1";
And to change the text in the other columns you'd use:

Code: Select all

myItem.subItems[0].text = 'text in column 2';
myItem.subItems[1].text = 'text in column 3';
Post Reply