dump

(#<widget> 'dump ?switches? index1 ?index2?)
Return the contents of the text widget from index1 up to, but not including index2, including the text and information about marks, tags, and embedded windows. If index2 is not specified, then it defaults to one character past index1.

The information is returned in the following format:

key1 value1 index1 key2 value2 index2 ...

This is 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.

The possible key values are text, mark, tagon, tagoff, and window. The corresponding value is the text, mark name, tag name, or window name. The index information is the index of the start of the text, the mark, the tag transition, or the window.

One or more of the following switches (or abbreviations thereof) may be specified to control the dump:

#:all
Return information about all elements: text, marks, tags, images and windows. This is the default.
#:command command
Instead of returning the information as the result of the dump operation, invoke the command on each element of the text widget within the range. The command has three arguments appended to it before it is evaluated: the key, value, and index.
#:image
Include information about images in the dump results.
#:mark
Include information about marks in the dump results.
#:tag
Include information about tag transitions in the dump results. Tag information is returned as tagon and tagoff elements that indicate the begin and end of each range of each tag, respectively.
#:text
Include information about text in the dump results. The value is the text up to the next element or the end of range indicated by index2. A text element does not span newlines. A multi-line block of text that contains no marks or tag transitions will still be dumped as a set of text seqments that each end with a newline. The newline is part of the value.
#:window
Include information about embedded windows in the dump results. The value of a window is its Tk pathname, unless the window has not been created yet. (It must have a create script.) In this case an empty string is returned, and you must query the window by its index position to get more information.

© Author | Home | Sitemap