listbox的一个控件使用范例

//访问Photoshop,并把应用程序放置顶层
#target photoshop
app.bringToFront();

var dlg = new Window('dialog', 'Alert Box Builder', [100,100,480,245]);
// create list box with two titled columns
var list = dlg.add ('ListBox', [0, 0, 150, 75], 'asd',
{numberOfColumns: 2, showHeaders: true,
columnTitles: ['First Name', 'Last Name']});
// add an item for the first row, with the label value for the first column
var item1 = list.add ('item', 'John');
// add the label value for the second column in that row.
item1.subItems[0].text = 'Doe';
// add an item for the second row, with the text for the first column label
var item2 = list.add ('item', 'Jane');
// add the label text and image for the second column in the second row
item2.subItems[0].text = 'Doe';
//item2.subItems[0].image = File ("~/Desktop/Step1.png");
dlg.show();

posted @ 2011-11-27 15:20  softimagewht  阅读(326)  评论(0编辑  收藏  举报