summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2001-11-15 11:55:26 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2001-11-15 11:55:26 (GMT)
commite10ad7411d1ec28dcfe30db1c03c8648af9b6020 (patch)
tree5830b0097e4cae430ecd6e2c802499b65e948719 /library
parent8b11780e6c3a8e88151528856efec3da20507ef0 (diff)
downloadtk-e10ad7411d1ec28dcfe30db1c03c8648af9b6020.zip
tk-e10ad7411d1ec28dcfe30db1c03c8648af9b6020.tar.gz
tk-e10ad7411d1ec28dcfe30db1c03c8648af9b6020.tar.bz2
Minor improvements to undo (demo,docs&bindings)
Diffstat (limited to 'library')
-rw-r--r--library/demos/text.tcl18
-rw-r--r--library/tk.tcl3
2 files changed, 17 insertions, 4 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
diff --git a/library/tk.tcl b/library/tk.tcl
index f62379b..5b7ac8c 100644
--- a/library/tk.tcl
+++ b/library/tk.tcl
@@ -3,7 +3,7 @@
# Initialization script normally executed in the interpreter for each
# Tk-based application. Arranges class bindings for widgets.
#
-# RCS: @(#) $Id: tk.tcl,v 1.32 2001/11/13 00:19:05 hobbs Exp $
+# RCS: @(#) $Id: tk.tcl,v 1.33 2001/11/15 11:55:26 dkf Exp $
#
# Copyright (c) 1992-1994 The Regents of the University of California.
# Copyright (c) 1994-1996 Sun Microsystems, Inc.
@@ -262,6 +262,7 @@ proc ::tk::EventMotifBindings {n1 dummy dummy} {
event $op <<Cut>> <Control-Key-w>
event $op <<Copy>> <Meta-Key-w>
event $op <<Paste>> <Control-Key-y>
+ event $op <<Undo>> <Control-underscore>
}
#----------------------------------------------------------------------