By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,537 Members | 1,416 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,537 IT Pros & Developers. It's quick & easy.

wx.ListCtrl - I do not see the inserted item

P: n/a
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(ind ex, 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

Jul 20 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.