beetlebug▾
/

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:

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

See also