On 8/7/2013 2:26 PM, Edward K. Ream wrote:
On Wed, Aug 7, 2013 at 10:45 AM, Jacob Peck <[email protected]
<mailto:[email protected]>> wrote:
This is a seemingly simple task, but I'm lost. Is there an easy
way to delete a node and all of it's clones?
This is a special case of a topic that has recently had a surprising
conclusion. See the thread:"A shock: p.deletePositionsInList must be
rethought and rewritten"
https://groups.google.com/forum/#!searchin/leo-editor/deletePositionsInList/leo-editor/IWMWhUlkos0/h1LD8aOw1IIJ
<https://groups.google.com/forum/#%21searchin/leo-editor/deletePositionsInList/leo-editor/IWMWhUlkos0/h1LD8aOw1IIJ>
The conclusion: one must use a vnode-oriented approach to deleting
multiple nodes, not a position-oriented approach.
c.deletePositionsInList does this.
Edward
Thanks for that pointer.
The following code (in a button or a command) accomplishes what I'm
setting out to do:
----
@language python
mypos = p.copy()
alist = [pos.copy() for pos in c.all_positions() if pos.v == mypos.v]
c.deletePositionsInList(alist)
c.redraw()
----
Looks like another entry for my myLeoSettings.leo.
-->Jake
--
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.
For more options, visit https://groups.google.com/groups/opt_out.