On Wed, 1 May 2013 23:53:02 -0700
Matt Wilkie <map...@gmail.com> wrote:

> NameError: name 'self' is not defined
> --------------------
>   line 32:
> * line 33: c.createLastChildNode(self, parent, my_head, my_body_text)

When you call a method (createLastChildNode) on an instance (c) like
that self is supplied implicitly, it's a reference to c.  So you'd want
c.createLastChildNode(parent, my_head, my_body_text), except of
course you probably want p.insertAsLastChild():

    p = c.p
    nd = p.insertAsLastChild()
    nd.h = my_head
    nd.b = my_body_text
    ...
    c.redraw()

I don't find insertAsLastChild in http://leoeditor.com/scripting.html

Another blog topic - building trees from scripts...

Cheers -Terry

-- 
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 leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
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.


Reply via email to