wxListCtrl GetItem() with column parameter

I am trying to set the text color of a list control item in column 1. The
documentation implies that this should work, but there seem to be no
examples of this in the demo, and I can't get it to work.

In the wxWindows documentation under the GetItem() method, the claim is
made that: "wxPython note: The wxPython version of this method takes an
integer parameter for the item ID, an optional integer for the column
number, and returns the wxListItem object."

Following the demo, I'm trying code like:

     listCtrl.SetStringItem(itemIndex, 1, mytext)
        item = listCtrl.GetItem(itemIndex, 1)
        item.SetTextColour(mycolor)
        listCtrl.SetItem(item)

But what I discover is that:

1. Using GetItem with only a single parameter ('GetItem(itemIndex)') works,
but of course makes the entire row the specified color.
2. Using GetItem(itemIndex, 0) seems to have exactly the same effect as
GetItem(itemIndex).
3. Using GetItem(itemIndex, 1) results in no color change.

The OS is Windows. Am I missing something obvious here?

···

--------------------------------------
Gary H. Merrill
Director and Principal Scientist, New Applications
Data Exploration Sciences
GlaxoSmithKline Inc.
(919) 483-8456

I'm trying to pickle a dict of wxBitmap ...
it store something, without errors
but when i try to unpickle it : it makes a GPF (under w2k)

do you know if it is possible ?

i answer my self ...

it's certainly because wxBitmap is not pickle-friendly
so we need to adapt it ....

here's the code to render wxImage pickle-friendly : (code from http://lists.wxwindows.org/archive/wxPython-users/msg03981.html.)

import pickle, zlib
def bind( classObject, outFunction, inFunction ):
    """Bind get and set state for the classObject"""
    classObject.__getstate__ = outFunction
    classObject.__setstate__ = inFunction

def wxImageOut( value ):
    width,height = value.GetWidth(), value.GetHeight()
    data = value.GetData()
    data = zlib.compress( data )
    return ( width, height, data )
def wxImageIn( self, (width, height, data) ):
    self.this = apply(imagec.wxEmptyImage,(width,height))
    self.thisown = 1
    self.SetData( zlib.decompress( data) )

bind( wxImagePtr, wxImageOut, wxImageIn )

3rs wrote:

···

I'm trying to pickle a dict of wxBitmap ...
it store something, without errors
but when i try to unpickle it : it makes a GPF (under w2k)

do you know if it is possible ?

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org