On Tuesday, November 22, 2016 at 3:05:05 AM UTC-6, Edward K. Ream wrote:
>> it would be simpler and better to have created a script :-)
> It was straightforward. Rev 93b9257 adds @button make-importer to
scripts.leo.
The original script copied the tree using c.k.simulate_command. This
flashes the screen.
The proper way to copy a tree without flash is to use
p.copyTreeFromSelfTo(). Like this:
def copy_tree(source, root, h):
'''Copy the source tree to the node after root, with headline h.'''
p2 = root.insertAfter()
source.copyTreeFromSelfTo(p2)
p2.h = h
return p2
EKR
--
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 https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.