Mike, unless I’m missing something in the wiki page you’ve cited, that’s
not what I’m talking about.
Apparently the red color of
“really” in my example “This
is really nice.” got lost between here
and there.
In report mode, I need to be able to change the color of =part= of the
text in a single column of a given item.
JUST AS I WAS ABOUT TO SEND THIS: Ah, I see that Robin has just
replied to my note (thanks, Robin!), and that the ListCtrl does not
support what I’m looking for.
So I guess I’m going to have to use a Grid control after all, with a
custom renderer; I =think= that’ll do the job, based on what I’ve read so
far. IF I’M WRONG ABOUT THAT, I hope someone here will let me
know.
Regardless, I need a way =now= to support scrollable groups of rows of
styled text.
Whenever the data view control comes along, perhaps I’ll be able to
switch to that.
Bob
···
At 09:50 AM 8/30/2007, you wrote:
Bob,
-----Original Message-----
From: Bob Klahn
[
mailto:bobklahn@comcast.net]Sent: Wednesday, August 29, 2007 8:52 PM
To: wxPython users
Subject: ListCtrl – how to set an item’s text attributes
=within= a report column?
I am using a ListCtrl in report mode, and need to be able to
set list items’ text attributes =within= a column.
E.g., I might want an item’s text in a given column to look like
this: “This is really
nice.”How do I accomplish that? I’m hoping to be able to stay with
a ListCtrl and not have to switch to, say, a Grid control.
Apart from within-report-column text attribute setting, the
ListCtrl is doing everything else that I need.
Bob
I use SetStringItem() to set items within columns. If you have The
Book,it’s detailed on page 404. Otherwise, check the man page:
http://www.wxpython.org/docs/api/wx.ListCtrl-class.htmlThere’s also an example in the wiki:
http://wiki.wxpython.org/ListControlsMike