This is the scheme I use:
def delAllChildren(posx):
while True:
pos2 = posx.getLastChild()
if pos2:
pos2.doDelete()
else:
break
https://github.com/SegundoBob/leo_misc/blob/master/delAllChildren.leo
is a trivial .leo file that can be used to play with this function.
--
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.