On Thu, 23 May 2013 10:15:49 -0500
"Edward K. Ream" <[email protected]> wrote:

> On Thu, May 23, 2013 at 9:53 AM, Terry Brown <[email protected]>wrote:
> 
> Building large data visualization (i.e. throw away) trees is slow with
> > positions, but fast with vnodes.  I use this monkey patch:
> >
> > from leo.core.leoNodes import vnode
> > if not hasattr(vnode, 'insertAsLastChild'):
> >     def ialc(self):
> >         vnode(self.context)._linkAsNthChild(self, len(self.children))
> >         return self.children[-1]
> >     vnode.insertAsLastChild = ialc
> >
> 
> Cool.  As I look at p.deletePositionsInList, I can think of no reason why
> it should work.  It looks thoroughly broken.  Who wrote this trash?
> According to qblame, I did.  Hahaha.
> 
> I don't know how you are approaching the problem, Terry, but it seems to me
> that it's more natural to look at things from the data (vnode) point of
> view rather than the traversal (position) point of view.  If that is so,
> then having higher-level vnode methods, such as v.insertAsLastChild, makes
> a lot of sense.

I'm just building trees from scratch under an existing position, so
only insertAsLastChild is needed.  To delete it I just use
p.deletePositionsInList([top_node]).  I think deletePositionsInList
came into being to support the multiple selected node deletion case in
contextmenu.py - you can select multiple nodes using shift or ctrl and
the mouse and delete all of them at once with contextmenu's right-click
Delete.

But I think contextmenu.py may do its own thing without using
deletePositionsInList, you could have a look.

Cheers -Terry

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/leo-editor?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to