On Wednesday 24 September 2003 11:45 pm, Michal Pasternak wrote:
> Hi,
>
> do you know about any tips or documentation about using GTK widgets
> to display large amounts of data?
>
> I have some TreeViews (both TreeStore and ListStore), to which I have to
> insert a lot of data. Well, the scrolling seems fast enough, but the
> insertion of the data lasts some time. Aren't there any tips and tricks to
> make it a bit faster / less memory-consuming?

Yes.  Use the more general TreeModel class.

Here's how it works.  The data to be displayed in a TreeView can be
stored in ANY way the user finds convenient as long as the storage
method implements the TreeModel API.  The TreeStore and ListStore are
two classes which implement the TreeModel API (this the TreeView can
display them) *plus* they implement a few extra calls to easily (but
not-so-efficiently) push in data lines one-by-one.  But if you have a
more efficient way to store the data, then make your storage class
implement the TreeModel API (it consists of a dozen or two methods to
access the contents) and set it as the TreeView's model.

Gary Herron


_______________________________________________
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