This is a combined Metakit/wxPython question, but given my situation I
think it resides a bit more on the Metakit side.

Let's say I have a large Mk database that I want to display in a grid-like
format (wxGrid, for example).  What is the best way to approach this so
that the display is very fast?

Okay, we all know that kviewer and Brian's KitViewer do this, and that the
proper approach is to use an underlying wxPyGridTableBase.  But my problem
is a bit more complicated than just displaying what is actually in the rows
of the view.  In this db, all of the porperties are numeric (ints,
actually).  But these *represent* other things and what I want to display
is the string representations corresponding to (at least some of) the ints.
This requires accessing other databases to retrieve or compute the
appropriate string representation.  It is then this resulting "string-ized"
row that needs to be displayed in the grid.

Currently (first attempt and being largely ignorant of the almost
completely undocumented wxPyGridTableBase), I just loop through all the
rows in the view, construct the appropiate corresponding sequence for each
row (containing the strings instead of the ints), and add this to the
'data' sequence for the wxPyGridTableBase.  It works, but it's not real
fast.

What is the best way to accomplish this?  Should I, in Metakit, construct a
new view that has the strings in place of their numeric representations and
then somehow use this?  But then don't I still need to loop through it to
create the data sequence for the wxPyGridTableBase?  Is there a way to
quickly turn a view into a sequence of Python sequences: [ [prop1, prop2,
...], ...] which could then just be assigned as the wxPyGridTableBase data
object?

Should I convert to strings *before* I create the wxPyGridTableBase?  Or
should I use the numeric representations for the wxPyGridTableBase and
handle the conversions at "display time" through something like GetValue()?

Is all of this already done in some way within Brian's KitViewer code?  I'm
sure people must do this all the time.  It's just not obvious to me what
the best approach is.  Thanks for any hints.


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




_______________________________________________
metakit mailing list  -  [EMAIL PROTECTED]
http://www.equi4.com/mailman/listinfo/metakit

Reply via email to