wxPython listctrl

G

Gif

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)
 
M

Mike Driscoll

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)

Please re-post to the wxPython user's group: http://wxpython.org/maillist.php

I'm pretty sure they know how to do this.

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,141
Messages
2,570,813
Members
47,357
Latest member
sitele8746

Latest Threads

Top