[wxPython] wxGrid and as an object oriented spreadsheet

I was drawn to wxPython because of the wxGrid widgets: I'm interested in
using them to organize and display scientific data in the form of an "object
oriented spreadsheet". I would thus like to associate python objects with
wxGrid cells. Is there a standard wx-ish way to do this?

My default approach is to put all the objects in a persistent dictionary
and use a second dictionary to map cell (row,col) coordinates to objects.
Simple values like strings and integers in cells would be saved in a third
dictionary and saved with the object dictionary. This should work as long
as I keep everything in sync.

Many thanks to Robin and the wxWindows developers for a fantastic package.

-chris

···

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/wxpython-users

I was drawn to wxPython because of the wxGrid widgets: I'm interested in
using them to organize and display scientific data in the form of an

"object

oriented spreadsheet". I would thus like to associate python objects with
wxGrid cells. Is there a standard wx-ish way to do this?

My default approach is to put all the objects in a persistent dictionary
and use a second dictionary to map cell (row,col) coordinates to objects.
Simple values like strings and integers in cells would be saved in a third
dictionary and saved with the object dictionary. This should work as long
as I keep everything in sync.

If you derive a class from wxPyGridTableBase then its GetValue and SetValue
methods can map grid data to and from your objects however you wish.

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com
http://wxPython.org Java give you jitters?
http://wxPROs.com Relax with wxPython!

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/wxpython-users