Additional Command 'checksum'

pathName checksum

Computes a checksum over the whole widget content. The result is platform independent.

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

-all

Computes the checksum over all these elements: chars (characters and soft hyphens), tags, images, and windows. This is the default, and includes the following switches: -chars, -image, -tag, -window.

-chars

The computation considers all characters and soft hyphens.

-displaychars

If this option is given, then only those characters and soft hyphens which are not elided will be considered in the computation of the checksum.

-displaytext

If this option is given, then only those characters which are not elided will be considered in the computation of the checksum. Note that soft hyphens (Unicode point U+00AD) do not belong to this result.

-image

The computation considers all embedded images. In case of an image the name of the image will be used for the checksum computation.

-mark

The computation considers all marks. In case of a mark the name of the mark and his gravity will be used for the checksum computation. Note that the computation discards generated marks, and it discards the special marks current, insert, and sel.

-tag

Consider tag information in the checksum computation. The name of the tags associated to this data (characters, soft hyphen, image, or window) will be used for the checksum computation. But this computation also considers the priority of the tags.

-text

The computation considers all characters. Note that soft hyphens (Unicode point U+00AD) do not belong to this result.

-window

The computation considers all embedded windows. In case of a window the pathname of the window will be used for the checksum computation.

Sometimes a quick checksum computation is quite useful. One example: we do not use an undo stack, but we want to check at a certain point whether the content has been changed. Note that querying edit modfied or edit altered is not sufficient for such a check, because it's likely that these commands will return 'true' even if the content is finally unchanged. So this new command is also completing the new command edit irreversible, because it's possible that an irreversible text content is equal to the original text content.