text edit
Works on the undo stack and the modified flag.
PATHNAME edit canredo
PATHNAME edit canundo
PATHNAME edit modified ?BOOLEAN?
PATHNAME edit redo
PATHNAME edit reset
PATHNAME edit separator
PATHNAME edit undo
Description
The undo stack works with -undo 1:
canundoandcanredo: give 1 when an undo or a redo is possible.modified: gives the modified flag, or sets it with BOOLEAN. Each change of the content sets the flag, and a change of the flag sends<<Modified>>.undo: undoes the last edit, back to the last separator. With no edit, gives the errornothing to undo.redo: does again the last undone edit.reset: empties the undo stack and the redo stack.separator: ends the current edit in the undo stack.
Returns
1 or 0 for canundo, canredo, and modified with no BOOLEAN, else an empty string.
Examples
% text .ed -undo 1
> .ed insert end hello
> .ed edit undo
> .ed get 1.0 end-1c
% text .ed2
> .ed2 insert end x
> .ed2 edit modified
1
Errors
% text .ed3; .ed3 edit bogus
bad edit option "bogus": must be canundo, canredo, modified, redo, reset, separator, or undo
-errorcode NONE
% text .ed4 -undo 1; .ed4 edit undo
nothing to undo
-errorcode NONE
Facts
- Capability
- None.
- Tcl release
- Tcl 9.1 and 8.6.
- Since
- ztk 1.0.0-beta.1