wxPython listctrl

Gif pavloutefkros at gmail.com
Sat Mar 29 17:27:16 EDT 2008


I was wondering if there is a way to extract an icon from a file
(executable) and then add it in a listctrl. I also 'd like to know if
i can shorten the icon in order to fit in a listctrl item.
I've managed to get the icon from an icon file and add t as a listctrl
item but it remains 32x32.

code:
images = ['LimeWire.ico']

self.il = wx.ImageList(18, 10)
self.il.Add(wx.Bitmap(images[0]))

#This below raises an error saying that no handle was found for that
image
#self.ib = wx.IconBundle()
#self.ib.AddIconFromFile(r'LimeWire.exe', wx.BITMAP_TYPE_ANY)

self.listView1.SetImageList(self.il, wx.IMAGE_LIST_SMALL)
self.listView1.SetItemImage(0, 0)



More information about the Python-list mailing list