How do I insert text programmatically at the current insertion point

... of a text widget.


From some discussion on comp.lang.tcl:

 Neil Madden wrote:
 > 
 > .t index insert
 > 
 > thus:
 > .t insert [.t index insert] "Some text\n"
 > 

 It's even better than that, Neil.  The word "insert" is a special mark
 in the tag widget, so you can use it just like "end." 
 (See "Marks" and "The Insertion Cursor" on the text man page.)  
 So you can do this with just one call to the text widget:

  .t insert "insert" "Some Text\n"

 Bob

Category Example | Category String Processing