wx.ListCtrl - I do not see the inserted item

L

Laszlo Nagy

This is a ListCtrl descendant:

class MegaListCtrl(wx.ListCtrl):
<more code here....>

def InsertImageStringItem(self, index, label, imageIndex):
imageIndex =
self.imagelists[wx.IMAGE_LIST_SMALL].GetIndexByName(imageIndex)
print index,imageIndex,label,imageIndex
super(MegaListCtrl,self).InsertImageStringItem(index, label,
imageIndex)

<more code here....>

Here I create the list control instance:

lst = self.lstExtTables = MegaListCtrl(pnl,-1,style=wx.LC_REPORT)

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 = _("Table name")
lst.InsertColumnInfo(0, info)
sizer.Add(lst,proportion=1,flag=wx.EXPAND)

<more code here....>

Here I try to add some items:

if not extdbdef is None:
for tblref in extdbdef.tables:
tbl = tblref()
if not tbl is None:
print str(tbl.name)
lst.InsertImageStringItem(sys.maxint,
str(tbl.name), 'table')


This is the output of the program:

C:/Python24/pythonw.exe -u "T:/Python/Lib/mess/utils/DbSchemaDesigner.py"
client
2147483647 248 client 248
jn_client
2147483647 248 jn_client 248


However, the ListCtrl displays empty. I can see the gray column header,
but it has not text. The two items are probably added, because
InsertImageStringItem did not raise an exception, but the items are not
visible.

Do you have an idea what can be the problem?

Thanks,

Laszlo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top