One of the many options of the text widget tag is the boolean -invisible property. When used, it must be born in mind that it doesn't merely affect the on-screen visibility of the contents of the text buffer to which the tag set with this option applies, but to the retrieval of the text too. The text widget get comment, returns the visible contents of the text view, if the actual contents of the displayed text buffer are needed, then the dump command should be used.
So, to return the visible contents of the text view use:
$wid get
But to return the entire text content of the text buffer, use:
$wid dump text start end
Comments