Virtual list boxes (using GtkTreeView or other)

2007-06-01 Thread Nuno Lucas
Hello,

I have been googling for some form of virtual list boxes, but can't
seem to find any reference.

How people do with very large list boxes? I was hopping I could have
some form of just seting up the column headers and say I have 1
rows and let the widget ask me for the data when it needs it.

It seems a bit heavy to add 1 rows one at a time, as it seems I'm
forced to do even if I derive my own ListStore.

Any hints?


Regards,
~Nuno Lucas
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Virtual list boxes (using GtkTreeView or other)

2007-06-01 Thread Nuno Lucas
On 6/1/07, Andreas Stricker [EMAIL PROTECTED] wrote:
 Nuno Lucas schrieb:
  How people do with very large list boxes? I was hopping I could have
  some form of just seting up the column headers and say I have 1
  rows and let the widget ask me for the data when it needs it.
 
  It seems a bit heavy to add 1 rows one at a time, as it seems I'm
  forced to do even if I derive my own ListStore.

 You have to derive your own GtkTreeModel, if the predefined GtkListStore
 or GtkTreeStore are not sufficient (They simply stores all data at once).

I may be missing something, but I don't see a way to set the number of
virtual rows.

From what I see in the documentation, the only way to grow is by
appending a single row at a time (which I guess then emits the
row-changed signal and updates the scrollbar).

What seems to be missing is a way to say I already have 10k, 100k or
even 1M rows of data ready (at least I will cache that data myself).

Even if I implement my own GtkTreeModel, I don't see a way of escaping
this limitation. At least on the documentation.


Regards,
~Nuno Lucas

 Cheers, Andy
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Virtual list boxes (using GtkTreeView or other)

2007-06-01 Thread Nuno Lucas
On 6/1/07, David Nečas (Yeti) [EMAIL PROTECTED] wrote:
 On Fri, Jun 01, 2007 at 03:47:36PM +0100, Nuno Lucas wrote:
  
   You have to derive your own GtkTreeModel, if the predefined GtkListStore
   or GtkTreeStore are not sufficient (They simply stores all data at once).
 
  I may be missing something, but I don't see a way to set the number of
  virtual rows.

 See http://gwyddion.net/documentation/head/libgwydgets/GwyNullStore.php
 for a simple purely virtual store.  This is a cheap hack,
 but it demonstrates the point IMO.

Thanks! That is exactly the kind of sample I needed to look at!

  From what I see in the documentation, the only way to grow is by
  appending a single row at a time (which I guess then emits the
  row-changed signal and updates the scrollbar).

 You are mixing two things here:
 - if the model grows is must emit the row-inserted signal,
   because if it does not do this, the tree views showing it
   break
 - however, if no one is watching, namely when the model is
   created, it can be instantaneously created with a million
   of rows

I see. Now I understand. I only need to implement my own store
and make sure I only call gtk_tree_set_model() after I set the
number of rows I want.

 There are more troubles with huge tree views, namely the
 tree view needs to know the sizes of the columns and rows --
 even those not currently visible as they still affect what
 is visible.  So you will probably end up using all the
 confusing fixed size modes, and avoiding work in cell data
 functions for invisible cells.

I am aware of this kind of problems and am expecting them.

 However, for a milion of rows scrolling through the tree
 manually is no longer useful anyway, i.e. the user interface
 ceases to be suitable for the task.  You may want to use
 a multilevel or search+paging base interface instead --
 essentially something that avoids the signle list with
 a million of rows by design.

I agree, but that's what the boss wants ;-)

On the other hand, as I'm using a generic tree view to show a list, I
could use that property to show a next and previous page controls (as
owner drawn root columns) and restrict the ouput to some row limit.

 Yeti

Thank you, you were most helpful.

Best regards,
~Nuno Lucas
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list