diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2001-11-15 11:55:26 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2001-11-15 11:55:26 (GMT) |
commit | e10ad7411d1ec28dcfe30db1c03c8648af9b6020 (patch) | |
tree | 5830b0097e4cae430ecd6e2c802499b65e948719 /library/demos/text.tcl | |
parent | 8b11780e6c3a8e88151528856efec3da20507ef0 (diff) | |
download | tk-e10ad7411d1ec28dcfe30db1c03c8648af9b6020.zip tk-e10ad7411d1ec28dcfe30db1c03c8648af9b6020.tar.gz tk-e10ad7411d1ec28dcfe30db1c03c8648af9b6020.tar.bz2 |
Minor improvements to undo (demo,docs&bindings)
Diffstat (limited to 'library/demos/text.tcl')
-rw-r--r-- | library/demos/text.tcl | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/library/demos/text.tcl b/library/demos/text.tcl index 78a4d56..ca06917 100644 --- a/library/demos/text.tcl +++ b/library/demos/text.tcl @@ -3,7 +3,7 @@ # This demonstration script creates a text widget that describes # the basic editing functions. # -# RCS: @(#) $Id: text.tcl,v 1.2 1998/09/14 18:23:30 stanton Exp $ +# RCS: @(#) $Id: text.tcl,v 1.3 2001/11/15 11:55:26 dkf Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." @@ -23,7 +23,7 @@ button $w.buttons.code -text "See Code" -command "showCode $w" pack $w.buttons.dismiss $w.buttons.code -side left -expand 1 text $w.text -relief sunken -bd 2 -yscrollcommand "$w.scroll set" -setgrid 1 \ - -height 30 + -height 30 -undo 1 -autosep 1 scrollbar $w.scroll -command "$w.text yview" pack $w.scroll -side right -fill y pack $w.text -expand yes -fill both @@ -66,7 +66,19 @@ the insertion cursor to the end of the line, or it deletes the newline character if that is the only thing left on the line. Control-o opens a new line by inserting a newline character to the right of the insertion cursor. Control-t transposes the two characters on either side of the -insertion cursor. +insertion cursor. Control-z undoes the last editing action performed, +and } + +switch $tcl_platform(platform) { + "unix" - "macintosh" { + $w.text insert end "Control-Shift-z" + } + "windows" { + $w.text insert end "Control-y" + } +} + +$w.text insert end { redoes undone edits. 7. Resize the window. This widget has been configured with the "setGrid" option on, so that if you resize the window it will always resize to an |