Hello!

I'm trying to make a script which would replace a selected node in the 
outline with the node's "shell copy". The new node should have the same 
header and body as the original one with all children cloned. After 
creating the new node the original position should be deleted - and that 
does not work. Could you, please, give me a hint where an error is?

The script looks like this:

*# Replaces a node with its shell copy -*
*# a node with the copied header/body and cloned children*
shell_copy = p.insertBefore()
shell_copy.h = p.h
shell_copy.b = p.b

*# Preserve the order of the children:*
child_no = 0
for child in p.children():
    c.dragCloneToNthChildOf(child, shell_copy, child_no)
    child_no = child_no + 1

*# Keep it tidy*
shell_copy.contract()

*#Delete the old node*
p.doDelete() *# Does not delete the position. Wrong method?*

*# Select the newly created position*
c.redraw(shell_copy)

Alexey

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/69822b78-8a5d-4539-b6f2-ced141318af7n%40googlegroups.com.

Reply via email to