hi,

I want to select text in body, make a childnode with that text,
and insert the section reference(like <<xxx>>) before the select
text, but the insert text would disappear when I redraw, here is
the code:

# insert section(selecting text as section name)
w = c.frame.body.bodyCtrl # Leo's body pane.

i,j = w.getSelectionRange(sort=True)
s = w.getSelectedText()             # Return the selected text, if any.
sectionName = g.angleBrackets(s)

w.insert(i, sectionName+"\n")

child = p.insertAsLastChild()
child.initHeadString(sectionName)

c.redraw()

-- 
--
Sincerely,

HaveF

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to