luna80
luna80

Reputation: 153

listctrl, column image not show

I don't understan why the image in the first colum is not shown... here my code

...
self.imgEntrata = wx.Image("entrata.png", wx.BITMAP_TYPE_PNG)
self.imgUscita = wx.Image("uscita.png", wx.BITMAP_TYPE_PNG)
self.listaFatture = wx.ListCtrl(self, size=(frame.GetSize().Width - 30, frame.GetSize().Height - 250), style=wx.LC_REPORT|wx.BORDER_SUNKEN)
...

self.listaFatture.InsertItem(i, '')

images=[self.imgEntrata, self.imgUscita]
il = wx.ImageList(16,16)
il.Add(images[0].ConvertToBitmap())
il.Add(images[1].ConvertToBitmap())
self.listaFatture.SetImageList(il, wx.IMAGE_LIST_SMALL)

if fattura[0] == 1:
    self.listaFatture.SetItem(i, 0, '', 0)
else:
    self.listaFatture.SetItem(i, 0, '', 1)

...  

Can somebody help me please? Ask if you need more information. thanks a lot in advance.

Upvotes: 1

Views: 93

Answers (1)

luna80
luna80

Reputation: 153

In case of somebody has the same problem, I found the solution...it should be use the function AssignImageList rather then SetImageList. So it works :)

Upvotes: 1

Related Questions