python - Images in wx.ListControl are cut off -
i have wx.listctrl in report mode , use image list display icons 50x50 pixels setitemcolumnimage. problem text display in column right of icon less 50 pixels high , parts of icons higher text cut off.
is there way tell listctrl adjust row height height of icons? last refuge change fontsize of text, there should better way.
update:
here of code:
self.list = util.listctrl(nb, style=wx.lc_report| wx.lc_single_sel|wx.lc_no_header|wx.lc_align_left) self.list.insertcolumn(0, 'avatar', width=-1) self.list.insertcolumn(1, 'name', width=-1) self.list.setcolumnwidth(0, 50) self.imagelist = wx.imagelist(50, 50, 255, 20) self.list.setimagelist(self.imagelist, wx.image_list_small) = 0 user in self.users: self.list.append(['', user['name']]) if user['avatar']: bitmap = wx.bitmapfromimage(user['avatar']) imageidx = self.imagelist.add(bitmap) self.list.setitemcolumnimage(i, 0, imageidx) += 1
when remove lc_report flag images visible displayed in 1 row , names aren't visible anymore.
since images 50x50, don't think qualify "small" more. try using wx.image_list_normal instead of wx.image_list_small. can't find manually setting row height, i'm guessing that's not possible. however, did find bug report on topic says resolved in wx2.9. using 2.9?
alternatively, use ultimatelistctrl pure python , if doesn't have ability, can patched author responsive.
Comments
Post a Comment