From: anrxc <an...@hi...> - 2005-11-22 00:13:59
|
Hi, I'm trying to display an image for every item in the MultiColumnList. So after some time looking at wxPython code I came up with: import wx, sys from PythonCard import model bljak = ['a','b','c'] class Template(model.Background): def on_initialize(self, event): self.il = wx.ImageList(16, 16) self.idx1 = self.il.Add(wx.Bitmap('arhiva.png', wx.BITMAP_TYPE_PNG)) self.components.listo.SetImageList(self.il, wx.IMAGE_LIST_SMALL) itemks = enumerate(bljak) for bla, data in itemks: index = self.components.listo.InsertImageStringItem(sys.maxint, data[0], self.idx1) self.components.listo.SetItemData(index, bla) if __name__ == '__main__': app = model.Application(Template) app.MainLoop() This works, but is there a more 'proper' way to write this? Thank you... -- Adrian C. (anrxc) | PGP:0xA8916BBD | xmpp:an...@ja... | ICQ:237982949 |