You must to do:
self.list.SetItem(item) with each item (don´t ask me why)
and maybe
self.list.Refresh()
···
-----Original Message-----
From: Robin Becker [SMTP:robin@jessikat.fsnet.co.uk]
Sent: Tuesday, August 08, 2000 1:09 PM
To: wxpython-users@wxwindows.org
Subject: Re: [wxPython] ListItemsIn article <010f01c00100$e85e0f00$0b01a8c0@ARES>, Robin Dunn
<robin@alldunn.com> writes
>>
>> I was hoping someone could help me with changing the color of a single
>item in
>> the ListCtrl. The docs talk about modifying a ListItem, but I haven't
>been
>> able to successfully get it to work. Any one have any sample code?
>>
>
> item = self.list.GetItem(itemID)
> item.SetTextColour(wxBLUE)
> self.list.SetItem(item)
>
>--
funny I see no change at all after I changed the wxListCtrl.py demo so
the setup loop looked likefor x in range(len(items)):
key, data = items
self.list.InsertImageStringItem(x, data[0], idx1)
self.list.SetStringItem(x, 1, data[1])
self.list.SetStringItem(x, 2, data[2])
self.list.SetItemData(x, key)
if data[0]=='Billy Joel':
i = self.list.GetItem(x,0)
i.SetTextColour(wxBLUE)
i = self.list.GetItem(x,1)
i.SetTextColour(wxRED)
i = self.list.GetItem(x,2)
i.SetBackgroundColour(wxBLUE)
elif data[0]=='bad English':
i = self.list.GetItem(x)
i.SetTextColour(wxBLUE)--
Robin Becker_______________________________________________
wxPython-users mailing list wxPython-users@wxwindows.org
http://wxwindows.org/mailman/listinfo/wxpython-users