[Tutor] (no subject)
Andy Baker
andy at andybak.net
Mon Apr 19 14:20:26 EDT 2004
>
> You're completely correct. So when you're done writing your
> WxPython tutorial, please send it to me, and I'll be more
> than happy to proofread it. ;)
>
> Later,
> Blake.
>
You wait!
:-)
As it turned out I was getting rather mixed up. I was getting mixed up. I
remembered needing one command to set a new row and another to add an item
to another column in that row. SetItemData was just a red herring.
This is what I was looking for:
self.list.InsertStringItem(row,string)
self.list.SetStringItem(row, column, string)
So I get the following:
for i, row in enumerate(list):
for j, item in enumerate(row):
if j==0:
self.list.InsertStringItem(i,item)
else:
self.list.SetStringItem(i, j, item)
The conditional statement is there to set up the column on the first item
and merely add a column to it after that. Does anyone know a more elegant
way to do this?
More information about the Tutor
mailing list