get

(#<widget> 'get index1 ?index2 ...?)
Return a range of characters from the text.

The return value will be all the characters in the text starting with the one whose index is index1 and ending just before the one whose index is index2 (the character at index2 will not be returned).

If index2 is omitted then the single character at index1 is returned. If there are no characters in the specified range (e.g. index1 is past the end of the file or index2 is less than or equal to index1) then an empty string is returned.

If the specified range contains embedded windows, no information about them is included in the returned string.

If multiple index pairs are given, multiple ranges of text will be returned in a proper Tcl list.

A Tcl/Tk list is just a string. Tcl/Tk does use a list data type, but instead uses procedures which handle strings as list-typed data.

The procedure (tcl-llist->scheme-list str) converts a Tcl/Tk list to a proper cons'd Scheme list.

This is done in an heuristic manner. Numbers are converted to strings because of the text widget's index notation.

Invalid ranges will not be represented with empty strings in the list.

The ranges are returned in the order passed to get.


© Author | Home | Sitemap