Page 1 of 1
multi-column listbox
Posted: January 12th, 2010, 10:41 am
by kingkai
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.
Re: multi-column listbox
Posted: January 30th, 2010, 11:46 am
by Paul Tuersley
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:
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';