Additional State 'readonly'

Command-Line Name: -state
Database Name: state
Database Class: State

Specifies one of three states for the text: normal, disabled, or readonly. If the text is disabled then characters may not be inserted or deleted and no insertion cursor will be displayed, even if the input focus is in the widget. If the state is read-only then characters can be inserted and deleted, but the widget does not receive any modifications from GUI, the user cannot delete or insert, and no insertion cursor will be displayed.

When hyphenation support is enabled (widget option -hyphens) switching the state to normal is re-displaying the text content without the use of soft hyphens for line break. Switching the state back to readonly, or disabled, is re-displaying the content regarding soft hyphens for possible line breaks.

This missing state simplifies the handling of the widget, the annoying workaround [$w configure -state normal/disabled] is not required anymore. Now it is more clear how the widget will be used, whether modifications from GUI are expected, and if the content will be modifiable at all. The introduction of the third state is obviously not influencing the behavior of older applications.

The new state readonly is also important for the hyphenation support. Switching the state from disabled to normal and back (as a work-around for the missing readonly state) is re-displaying the whole content when hyphenation support is enabled. With the proper state readonly this will be avoided.