summaryrefslogtreecommitdiffstats
path: root/library/demos/text.tcl
diff options
context:
space:
mode:
authorwolfsuit <wolfsuit>2002-02-05 02:25:13 (GMT)
committerwolfsuit <wolfsuit>2002-02-05 02:25:13 (GMT)
commitbcdb604e358027dd76ac168778b14546a8019d8a (patch)
tree32f54ef11288f0dd53eb468b143ef224897cdefc /library/demos/text.tcl
parentefc846c18b6df17d9dfd3b527214ec413d5f175f (diff)
downloadtk-bcdb604e358027dd76ac168778b14546a8019d8a.zip
tk-bcdb604e358027dd76ac168778b14546a8019d8a.tar.gz
tk-bcdb604e358027dd76ac168778b14546a8019d8a.tar.bz2
Merge with current TOT
Added support for the wm stackorder command Fixed crash when selecting Menu items in the Application menu that we didn't put there. Added first bits of the use of CG for low-level drawing. The line-drawing works, the rest doesn't yet. You have to set the file static useCGDrawing to 1 and rebuild to activate this code.
Diffstat (limited to 'library/demos/text.tcl')
-rw-r--r--library/demos/text.tcl18
1 files changed, 15 insertions, 3 deletions
diff --git a/library/demos/text.tcl b/library/demos/text.tcl
index 78a4d56..2237acd 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.2.24.1 2002/02/05 02:25:16 wolfsuit 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