TreeView performance/simplicity



Hi,

I've been working with the Gtk2-TreeView and TreeStore, and am really
impressed with the bindings.  I started out using the SimpleList
wrapper, but found its limitations quickly (good for simple things, as
the name suggests).

Anyway, I thought I'd let you know that I've been playing with a file
system front-end, with an instant-messenger sort of interface (like
Dashboard, but for managing documents/blog entries).  In some simple
tests, I've found that the TreeView can be populated with several
hundred items, in a way that performs much better than I expected
(milliseconds) .. and this is from file -> hash -> tree store.  I was
thinking that the 'dual' data store would bork performance, but testing
proved me very wrong -- perl, gtk2-perl bindings, and gtk2 perform well
together.  This is using Gtk2/Gtk2-GladeXML from a month-old CVS build.

I was also surprised how simple TreeStore is to use.  For some reason I
assumed it was some sort of terrible evil, because of the SimpleList
wrapper (the need to wrap hints at complexity).  The TreeStore is
actually trivial to use.  The SimpleList wrapper does make working with
the data nice, but doesn't support the TreeView stuff (not that it
should).  A SimpleTree wrapper, based on ties to two hashes (column
headers, and hierarchal data), would be fairly trivial to put together
as I'm already seeing a common pattern of use for the TreeStore, but
most advanced uses would be limited by the single-store.

I'm also thinking that I'll put together another example program that
shows how to use a TreeView/TreeStore with Gtk2/Gtk2-GladeXML.  I'll 
look at adding details to the documentation when I'm back from holidays
next week (unless someone else is working on that), as the questions
I've had (and answered) were not in my last build of the docs.

I know I've said this before, but Gtk2-perl is good stuff: I'm able to
whip through prototyping ideas in minutes, and that's without much in
the way of documentation.  The current examples are a great basis, and
the bindings just seem to work (even though few people are testing the
GladeXML stuff).  Thanks for the great bindings!

Cheers,

-- 
Bruce Alderson <mx warpedvisions org>
http://warpedvisions.org




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]