[wxPython-users] Grid Cell Renderer

Robin Dunn robin at alldunn.com
Wed Jan 2 16:56:04 PST 2008


Mark Erbaugh wrote:
> Is there a simple Grid Cell renderer that would allow me to simply
> convert the cell's value to a string? Or is there another place to
> convert the cell's data to a display string?
> 
> I'm using a GridTable and I know I could do the conversion in the
> GetValue method, but that seems like adding a view-specific function to
> the model. Also, I've written a Grid Cell editor that  needs the raw
> cell value, so I would like to have GetValue return that.

The table's GetValue is supposed to always deal with strings in order to 
comply with the API.  There is some limited support to query the table 
and find out if it can provide the value as other types, but so far it 
can only deal with longs, doubles and bools.  In the past I've thought 
that it would be nice for the table to be able to provide the data as a 
PyObject* (ie, any Python object) but I haven't tried implementing that 
yet.


-- 
Robin Dunn
Software Craftsman
http://wxPython.org  Java give you jitters?  Relax with wxPython!




More information about the wxpython-users mailing list