I think I found a good solution. I was trying to use deleteallitemsinlist 
but could not get it to work (it would erase only the first node on the 
list, well i just couldnot).
So now Im using this one which works perfectly:

First make a list (Nodetodeletelist) with the list of nodes gnx's, then

FoundOne=1

Keeptesting=1

while FoundOne==1:

    Keeptesting=0

    for ChildsToErase in c.p.subtree():

        if ChildsToErase.gnx in NodesToDeleteList:

        ChildsToErase.doDelete()

        Keeptesting=1

    if Keeptesting==0:

        FoundOne=0



On Monday, May 20, 2013 9:33:31 PM UTC+2, Edward K. Ream wrote:
>
> On Fri, May 17, 2013 at 2:42 PM, SegundoBob <[email protected]<javascript:>
> > wrote:
>
>> This is the scheme I use:
>>
>> def delAllChildren(posx):
>>     while True:
>>         pos2 = posx.getLastChild()
>>         if pos2:
>>             pos2.doDelete()
>>         else:
>>             break
>>
>
> This looks like it should work well, because it deletes children in 
> reverse order, which is a standard trick when working with positions.
>
> Again, however, I should point out that p.deletePositionsInList is 
> attempting to solve a more genera;, and much harder, problem.
>
> Clearly, this is a problem of interest to many people.  Solving it, and 
> *proving* that it is solved, is high on my list of to-do items.
>
> Edward
>

-- 
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.


Reply via email to