<[EMAIL PROTECTED]> wrote:

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?
[...]
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.

Quick (not well thought-through) response:


This is where mk.wrap() can probably help. Define a view which wraps the MK view, and produces values in the way you need them. Then, access to items will go through your Python wrapper *on-demand*.

The whole trick of KitView.exe (and I presume Brian's KitViewer) is "delayed rendering". Scrolling across an infinite number of rows can be instant. The issue is not doing more work than needed - and if you think about it, KitView does exactly the same as what you're after: take data out of MK, and present it in transformed way on the screen (namely visually).

Back in the times when KitView.exe was built, I had only Borland C++ Builder's "datagrid" which was up to this task. Many simpler GUI approaches ask you to "fill" a matrix or listbox before using them. Nowadays, there are several widgets in Tk (TkTable as well as pure tcl ones such as Hugelist) which can play this on-demand delayed-rendering trick. I don't know wxPython (or wxWindows) unfortunately - but it can no doubt also do this.

With Mk4py's wrap() you can create MK "views" which are virtual *and* which go through arbitrary Python code on each item access request. It's sort of the equivalent of MK's c4_CustomViewer class in C++, which is extremely powerful (many view operators are built on it).

-jcw

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

Reply via email to