I was playing with an image list, because I want to show icons in the
column headers of ListCtrl.
When I assign an image list to ListCtrl the first image in this list
is shown in the first column of each item in the list. All items were
inserted as string items. When I use SetItemImage(item, -1) the image
disappears, but there is still an empty space in its positions (the
text of the first columns has a padding now). Is there any way to get
rid of this empty space? Is there a general way to avoid displaying
the image for each item?
I work on WinXPProf., wxPython 2.5.5.1, Python 2.4. I can send both
code and screenshots if needed, but I think that I just miss some
setting or style flag (but I did search the docs).
I was playing with an image list, because I want to show icons in the
column headers of ListCtrl.
When I assign an image list to ListCtrl the first image in this list
is shown in the first column of each item in the list. All items were
inserted as string items. When I use SetItemImage(item, -1) the image
disappears, but there is still an empty space in its positions (the
text of the first columns has a padding now). Is there any way to get
rid of this empty space? Is there a general way to avoid displaying
the image for each item?
I work on WinXPProf., wxPython 2.5.5.1, Python 2.4. I can send both
code and screenshots if needed, but I think that I just miss some
setting or style flag (but I did search the docs).
On Windows the native ListView control has a "feature" that if you give it an image list then it assumes that you are going to want to display items with images, so it reserves the space for them automatically. One way to work around this is to shift everything one column to the right, so the first column has nothing in it except for the space reserved for the image. Then you can just set that column's width to zero.
ยทยทยท
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!