I have some hacked together code from the demo files and such. I'm looking
to create a cover art grabber from amazon and I want to list all the
artists, album and cover art it finds. Now I can place text in and if it
found the cover art or not but if it finds the art i want it to show up in
the list also.
Here is some sample code
class TestListCtrlPanel(wxPanel, wxColumnSorterMixin):
def __init__(self, parent):
wxPanel.__init__(self, parent, -1, style=wxWANTS_CHARS)
tID = wxNewId()
self.il = wxImageList(16, 16)
#self.idx1 = self.il.Add(self.getSmilesBitmap())
#self.sm_up = self.il.Add(images.getSmallUpArrowBitmap())
#self.sm_dn = self.il.Add(images.getSmallDnArrowBitmap())
#jpg = wxImage(self.opj('Reanimation.jpg'),
wxBITMAP_TYPE_JPEG).ConvertToBitmap()
self.list = TestListCtrl(self, tID,
style=wxLC_REPORT | wxSUNKEN_BORDER
#| wxLC_EDIT_LABELS
#| wxLC_NO_HEADER
#| wxLC_VRULES | wxLC_HRULES
)
self.list.SetImageList(self.il, wxIMAGE_LIST_SMALL)
self.ShowHeader()
wxColumnSorterMixin.__init__(self, 3)
#self.SortListItems(0, True)
EVT_SIZE(self, self.OnSize)
def newRow(self, data):
# checking to see if the list is full
data.append("----- NOTHING -----")
data.append("----- NOTHING -----")
self.list.InsertStringItem(0, data[0])
self.list.SetStringItem(0, 1, data[1])
self.list.SetStringItem(0, 2, data[2])
jpg = wxImage(self.opj('Reanimation.jpg'),
wxBITMAP_TYPE_JPEG).ConvertToBitmap()
#self.list.SetItemImage(0, 2, jpg)
#self.list.InsertImageStringItem(0, data[2], jpg)
self.list.GetItem(0).SetImage(jpg)
the first 3 self.lists are setting text.. but for the life of me I cannot
get it to load a image in there. Is this even possible?
Thanks
Mike