[pygtk] Howto set the length of GenericTreeModel

Richard Taylor rjt-pygtk at thegrindstone.me.uk
Wed Jan 25 04:19:41 WST 2006


Hi

I am trying to build a subclass of GenericTreeModel for use with a large 
Berkeley DB database. I have it just about working but one thing I noticed is 
that TreeView appears to work out the length of the GenericTreeModel by 
repeatably calling GenericTreeModel.on_iter_next(iter). For a large tree this 
can take a long time.

As I know the size of the Model I would like to be able to just tell the 
TreeView what it is without it having to do all those calls.

Is there anyway to do this?


BTW: I already have set_fixed_height_mode(True) on the TreeView and 
set_sizing(gtk.TREE_VIEW_COLUMN_FIXED) on all the TreeViewColumns with the 
widths explicitly set with set_fixed_width(100). So the TreeView is not 
walking the model in order to get the column widths.

Many thanks

Richard

-- 
You can normally find me on Jabber as RichardTaylor at jabber.org


More information about the pygtk mailing list