I can now move the current node somewhere by doing thisnewnode = c.p.copy()dest = g.findNodeAnywhere(c,'A')newnode.moveToLastChildOf(dest)c.redraw()but what I want is to create a new node with the same values -- I don't think p is the answer for me here
On Saturday, June 4, 2016 at 7:15:17 AM UTC+5:30, Conor White-Sullivan wrote:Hey all,I have a couple scripts I'd like to write -- I think they're pretty simple, but I'm new to python and leoIf anyone can help I'd appreciate itScript 1 : Creating Children of current based on selected textGoal: I'd like to1. get the value of the text that is currently selected2. create a new node, which has that text as both its headline and bodyIt was unclear from the tutorial how to just create a new node with any arbitrary content
I have a couple scripts I'd like to write -- I think they're pretty simple, but I'm new to python and leoIf anyone can help I'd appreciate it
Script 1 : Creating Children of current based on selected textGoal: I'd like to1. get the value of the text that is currently selected
2. create a new node, which has that text as both its headline and bodyIt was unclear from the tutorial how to just create a new node with any arbitrary content
Bonus:1. Trigger a little popup that lets me put in the value of what I'd like to name this new child
2. remove the selected text and replace it with the value << 'whatever I named the new child node in the prompt' >>
----- Also, what is the best way to discover how to do these kind of things without asking others?
Script 1 : Creating Children of current based on selected textGoal: I'd like to1. get the value of the text that is currently selected2. create a new node, which has that text as both its headline and bodyIt was unclear from the tutorial how to just create a new node with any arbitrary content3. set that node be a child of the currently selected noderequires: getting the position of the current node
Bonus:1. Trigger a little popup that lets me put in the value of what I'd like to name this new child2. remove the selected text and replace it with the value << 'whatever I named the new child node in the prompt' >>