Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to make icons invisible on wx.ListCtrl in report mode?
    primarykey
    data
    text
    <p>I have to get a list with just two string columns. On GTK everything is ok, but on windows 7 I get this: <img src="https://i.stack.imgur.com/oY5p2.png" alt="Windows 7"></p> <pre><code>class ListViewCtrl(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin): def __init__(self, parent, ID, pos=wx.DefaultPosition, size=wx.DefaultSize, style=0): wx.ListCtrl.__init__(self, parent, ID, pos, size, style) listmix.ListCtrlAutoWidthMixin.__init__(self) class ListView(wx.Panel, listmix.ColumnSorterMixin): def __init__(self, parent): wx.Panel.__init__(self, parent, -1, style=wx.WANTS_CHARS) self.il = wx.ImageList(16, 16) self.up = self.il.Add(resources.filter_up.GetBitmap()) self.dn = self.il.Add(resources.filter_down.GetBitmap()) self.list = ListViewCtrl(self, -1, style=wx.LC_REPORT | wx.SIMPLE_BORDER | wx.LC_EDIT_LABELS | wx.LC_SORT_ASCENDING) self.list.SetImageList(self.il, wx.IMAGE_LIST_SMALL) i = 0 _program_dir = os.path.split(__file__)[0] self.itemDataMap = {} for fn in os.listdir(os.path.join(_program_dir, '../design/caps')): self.itemDataMap[i] = (fn, "Line {0}".format(i+1)) i += 1 self.PopulateList() listmix.ColumnSorterMixin.__init__(self, 3) self.__DoLayout() def __DoLayout(self): sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(self.list, 1, wx.EXPAND) self.SetSizer(sizer) self.SetAutoLayout(True) def PopulateList(self): info = wx.ListItem() info.m_mask = wx.LIST_MASK_TEXT | wx.LIST_MASK_IMAGE | wx.LIST_MASK_FORMAT info.m_image = -1 info.m_format = 0 info.m_text = "File name" self.list.InsertColumnInfo(0, info) info.m_text = "Column 2" self.list.InsertColumnInfo(1, info) for k, v in self.itemDataMap.items(): index = self.list.InsertStringItem(sys.maxint, v[0]) self.list.SetStringItem(index, 1, v[1]) self.list.SetItemData(index, k) self.list.SetColumnWidth(0, 100) self.list.SetColumnWidth(1, wx.LIST_AUTOSIZE) self.currentItem = 0 def GetListCtrl(self): return self.list def GetSortImages(self): return (self.dn, self.up) </code></pre> <p>Every line use the image number 0 from the attached image list. How can I get rid of this icons?</p> <p><em>wxPython 2.9.2.4, Win7 x64</em></p> <p><strong>UPDATE:</strong></p> <p>Here is a list from GTK (no icons as you see):</p> <p><img src="https://i.stack.imgur.com/XBCUS.png" alt="GTK"></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload