I have a situation in which I must regularly deal with data that
can be in excess of 250,000 (that's a quarter of a million, folks)
lines. Updating the list control "normally" can take up to 10 minutes,
and seems to cause memory thrashing. I would like to move over to a
virtual list control, and have constructed my data structure to do so.
However, there is a hitch. We need to highlight certain lines in a
different foreground/background color based on the contents of the line.
I have not seen any documented way of doing this. I tried,
without success (Memory Stack Overflow error), to set the color in the
OnGetItemText function. Is there an appropriate function to place the
code to set the colors?
Christopher Spencer
Developer
Merkur Group, Inc.
2950 Crescentville Rd.
West Chester, OH 45069
Toll Free: (800) 637-1704
Phone: (513) 612-8000
Fax: (513) 612-8080
However, there is a hitch. We need to highlight certain lines in a
different foreground/background color based on the contents of the line.
I have not seen any documented way of doing this. I tried,
without success (Memory Stack Overflow error), to set the color in the
OnGetItemText function. Is there an appropriate function to place the
code to set the colors?
You just need to implement the OnGetItemAttr method. See the demo.
···
--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters? http://wxPython.org Relax with wxPython!
I have a situation in which I must regularly deal with data that
can be in excess of 250,000 (that's a quarter of a million, folks)
lines. Updating the list control "normally" can take up to 10 minutes,
and seems to cause memory thrashing. I would like to move over to a
virtual list control, and have constructed my data structure to do so.
However, there is a hitch. We need to highlight certain lines in a
different foreground/background color based on the contents of the line.
I have not seen any documented way of doing this. I tried,
without success (Memory Stack Overflow error), to set the color in the
OnGetItemText function. Is there an appropriate function to place the
code to set the colors?
You can return the attributes in the OnGetItemAttr method: