summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--library/text.tcl17
2 files changed, 15 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 7d95bce..42d1917 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2000-07-19 Eric Melski <ericm@ajubasolutions.com>
+ * library/text.tcl: Enhanced <Tab> binding to behave like normal
+ <Tab> bindings when the text widget is disabled (ie, it advances
+ focus to the next widget).
+
* generic/tkText.c (TextSearchCmd): Added a test for a NULL
segment pointer when doing backwards searches for "" on an empty
text widget. [Bug: 6007].
diff --git a/library/text.tcl b/library/text.tcl
index 9eb2cd0..742f82f 100644
--- a/library/text.tcl
+++ b/library/text.tcl
@@ -3,7 +3,7 @@
# This file defines the default bindings for Tk text widgets and provides
# procedures that help in implementing the bindings.
#
-# RCS: @(#) $Id: text.tcl,v 1.12 2000/04/17 23:24:29 ericm Exp $
+# RCS: @(#) $Id: text.tcl,v 1.13 2000/07/19 23:22:20 ericm Exp $
#
# Copyright (c) 1992-1994 The Regents of the University of California.
# Copyright (c) 1994-1997 Sun Microsystems, Inc.
@@ -36,7 +36,7 @@
#-------------------------------------------------------------------------
#-------------------------------------------------------------------------
-# The code below creates the default class bindings for entries.
+# The code below creates the default class bindings for text widgets.
#-------------------------------------------------------------------------
# Standard Motif bindings:
@@ -182,9 +182,11 @@ bind Text <Control-Shift-End> {
}
bind Text <Tab> {
- tkTextInsert %W \t
- focus %W
- break
+ if { [string equal [%W cget -state] "normal"] } {
+ tkTextInsert %W \t
+ focus %W
+ break
+ }
}
bind Text <Shift-Tab> {
# Needed only to keep <Tab> binding from triggering; doesn't
@@ -740,7 +742,10 @@ proc tkTextResetAnchor {w index} {
global tkPriv
if {[string equal [$w tag ranges sel] ""]} {
- $w mark set anchor $index
+ # Don't move the anchor if there is no selection now; this makes
+ # the widget behave "correctly" when the user clicks once, then
+ # shift-clicks somewhere -- ie, the area between the two clicks will be
+ # selected. [Bug: 5929].
return
}
set a [$w index $index]