-
Listbox – Add Image
Hello friends,
my follow script will create a multicolumn listbox and I also would like to add an image in a row.
So far so good, but after the window appears there is no image. I click inside the Listbox and the image appears.
What I have forgot?
Thanks for your help
{
var res = "dialog\
myListbox: ListBox { alignment:['fill','fill'], properties:{\
multiselect:true, \
numberOfColumns:3, \
showHeaders:true, \
columnTitles: ['Header 1', 'Header 2', 'Header 3']}\
}";
var myPalette = new Window(res); //Creates Window
/// Row 1 Contents
var myItem1 = myPalette.myListbox.add ('item', 'Cell 1-1');
myItem1.subItems[0].text = 'Cell 1-2';
myItem1.subItems[1].text = 'Cell 1-3';
/// Row 2 Contents
var myItem2 = myPalette.myListbox.add ('item', 'Cell 2-1');
myItem2.subItems[0].text = 'Cell 2-2';
myItem2.subItems[1].text = 'Cell 2-3';
myItem2.subItems[1].image = File("~/Desktop/Asset 5.png");
myPalette.show();
}