Re: Treeview scrolling question



On Tue, Jan 07, 2003 at 03:11:12AM +0100, danny van elsen wrote:

ok, thanks for the answer, I already guessed that my approach wasn't 
the best possible ...

- after looking at the documentation and the pygtk example,
- considering that I will have in memory a <list> that contains a

On reflection, implementing your own TreeModel may be overkill (and doesn't
look all that fun in C).  If you have a list type structure you should get
all the benefits if you use a ListStore as your data structure (rather than
keeping a separate and redundant data structure *and* a ListStore).  Think
of the ListStore as an advanced type of list data structure (not a widget)
that you can use for anything a list is appropriate for, which can hold any
kind of GType, and which is completely separate from any TreeView.  The
ListStore just happens to be able to notify an associated view (or anyone
else who connects to its signals) when it changes, but it can be associated
with multiple views or no view at all.

You probably only want to wrap a data structure in your own TreeModel if you
have no control over the data structure, i.e. it's generated by a library
you need to use and you can't use a ListStore or TreeStore instead.  

Dave Cook



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