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.
multi-column listbox
Moderator: 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:
Then to add an item you can use something like:
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
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']} }, \
Code: Select all
var myItem = myPalette.myListbox.add ('item', 'this text will appear in column 1');
Code: Select all
myItem.text = "text in column 1";
Code: Select all
myItem.subItems[0].text = 'text in column 2';
myItem.subItems[1].text = 'text in column 3';