On Tue, Jul 22, 2003 at 03:07:56PM +0200, Peter Schulte-Stracke wrote:

> I am in desparate need of a List/Tree widget that does *not* read the whole
> database / model, but only a portion of it, essentially what is displayed.

I use "lazy" loading of a TreeStore.  I have several tables in a hierarchy,
and I just load the first, and then execute a query to determine which row
will have children.  For two tables composer and work this is:

select composer_id, composer_name from composer;
select distinct composer_id from work;

The results of the second query are put in a dictionary with composer_ids as
keys for fast lookups. Then for each composer row that will have work rows,
I append a single "indicator" row.  I then attach to the row-expanded signal
to determine when to actually add the children.

> This looks as an innocuous enough requirement, but I failed completely to
> get anything to work, or even to find a model implementation.

You might be able to rig something up by overriding ListStore methods.

> The libgnomedb appears to contain something in this direction, however
> a.t.m. I am still searching for it :-)
> 
> Anyway, it should not be that uncommon a requirement, because it is not
> uncommon to have large databases, and expensive per item processing.  
> 
> A minimum would be to disconnect the scrollbar from the listview, so that
> one could reflect the position in a data base of, say, 10000 records in
> the scrollbar, but only display the first twenty records, say, at the
> beginning.  Has anyone ever tried this?

I think someone here (or maybe it was gtk-app) has tried that.  I wonder if
it would buy you anything to just append blank rows after a certain cutoff
and then start setting them as the user scrolls down.

Dave Cook
_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to