Images are missing from ListView

Hi!

Please help me a little!
I don't know what I do wrong but the images are not visible in my LC.

Thanks for your help:
    dd

CALC.bmp (2.05 KB)

job.png

testlistctrl.py (1.54 KB)

Hi,

durumdara@gmail.com wrote:

Hi!

Please help me a little!
I don't know what I do wrong but the images are not visible in my LC.

Thanks for your help:
   dd

You need to add "self." to your ImageList, i.e.:

        self.ImageList = wx.ImageList(32, 32)
        def LoadImage(ImageFileName):
            data = open(ImageFileName, "rb").read()
            import cStringIO
            stream = cStringIO.StringIO(data)
            img = wx.BitmapFromImage(wx.ImageFromStream(stream))
            ImgIdx = self.ImageList.Add(img)
        LoadImage('job.png')
        LoadImage('calc.bmp')
        self.lv_queue.SetImageList(self.ImageList, wx.IMAGE_LIST_NORMAL)

I am actually surprised that it does not throw an exception without it, as I don't see where ImageList in LoadImage is defined.

Werner