[wxPython-users] wx.grid.GridCellEnumRenderer

Robin Dunn robin at alldunn.com
Wed Jan 2 16:55:35 PST 2008


Mark Erbaugh wrote:
> Are there any examples on how to use this renderer?  The python SWIG
> file indicates that it takes a string parameter choices, but looking at
> the C++ code, it looks like this should be a string array. wxPython only
> wants a string (or Unicode) as a parameter.

Try using comma separate values inside the string:

void wxGridCellEnumRenderer::SetParameters(const wxString& params)
{
     if ( !params )
     {
         // what can we do?
         return;
     }

     m_choices.Empty();

     wxStringTokenizer tk(params, _T(','));
     while ( tk.HasMoreTokens() )
     {
         m_choices.Add(tk.GetNextToken());
     }
}


I agree though that using a wxArrayString like wxGridCellChoiceEditor 
would have made a lot more sense.


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




More information about the wxpython-users mailing list