I will answer myself. > I would like to create a few buttons to insert template LaTeX code, > for example code for a new frame (i.e. slide), code for columns, etc. > However, I don't know how to insert text at the current cursor > position in the body pane?
s = "The string to insert" w = c.frame.body.bodyCtrl ip = w.getInsertPoint() w.insert(ip, s) w.setInsertPoint(ip + len(s)) # If you want to move the cursor to the end of the new string > Also, will the function g.app.gui.runAskOkCancelStringDialog() returns > None if the user clicked Cancel? Or will it return an empty string? > How about runAskOkCancelNumberDialog()? Returns None if Cancel was clicked. Truong. -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/leo-editor?hl=en.
