[wxPython-users] Grid Cell Renderer

Robin Dunn robin at alldunn.com
Wed Jan 2 17:00:05 PST 2008


Mark Erbaugh wrote:
> On Wed, 2008-01-02 at 06:58 +0100, Raffaello Barella wrote:
>> Could you please tell what kinds of data you want to convert to a
>> string?
>>

> 
> The data is an integer that corresponds to the string. I have a dict
> that has the integer as the key and the string as the value.
> 
> wxPython has a GridCellEnumRenderer but I can't seem to get that working
> and other than it's existence, I can't find any documentation on it.
> It's not listed in the wxWidgets documentation, although it is there in
> the C++ code.

If you really want to keep the integer values all the way through then 
try implementing GetValueAsLong(self, row, col) in the table, and also 
CanGetValueAs(self, row, col, typeName) and return true for that cell 
for typeName == "long".  Otherwise the grid, editors, and renderers 
should translate the value to/from strings as needed.

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




More information about the wxpython-users mailing list