can't see list text of a wxPython ListCtrl widget
Ole Fostad
ole.fostad at netcom.no
Sun Apr 14 06:17:32 EDT 2002
Hi!
Replace
"self.list.SetStringItem(0, 0, 'ho')" with "self.list.InsertStringItem(0,
'ho')" and
"self.list.SetStringItem(1, 0, 'ho')" with "self.list.InsertStringItem(1,
'ho')"
Ole
"sameer" <sameer_ at email.com> wrote in message
news:6bd9f01b.0204131604.6031da9e at posting.google.com...
> hi,
> I am playing around with the wxPython ListCtrl widget, and for some
> reason I can't figure out, I am not seeing the text I add to the list.
> I can see the Column Names just fine, just not any item in the list.
> I am pasting the important code below which is part of an init method
> of a wxPanel.
>
> tID = wxNewId()
> self.list = wxListCtrl(self, tID, pos = (5, 5),
> style=wxLC_REPORT)
> self.list.SetDimensions(5, 5, 400, 200)
> self.list.InsertColumn(0, "Subject")
> self.list.InsertColumn(1, "Entry")
> self.list.InsertColumn(2, "Date")
> self.list.SetColumnWidth(0, 100)
> self.list.SetColumnWidth(1, 100)
> self.list.SetColumnWidth(2, 100)
> self.list.SetStringItem(0, 0, 'ho')
> self.list.SetStringItem(0, 1, 'b...')
> self.list.SetStringItem(0, 2, '0-2002')
> self.list.SetStringItem(1, 0, 'ho')
> self.list.SetStringItem(1, 1, 'b...')
> self.list.SetStringItem(1, 2, '0002')
>
>
>
> Thanks in advance for the help.
More information about the Python-list
mailing list