diff options
author | ericm <ericm@noemail.net> | 2000-07-19 23:22:19 (GMT) |
---|---|---|
committer | ericm <ericm@noemail.net> | 2000-07-19 23:22:19 (GMT) |
commit | d29aa789317aa6145c2253e4f2d60e1084add2a2 (patch) | |
tree | c0ebca932a0af1d9313df97e90b397605a13d1e3 /library/text.tcl | |
parent | 092af5ef22c1205e446e166f8492d4786f3c916c (diff) | |
download | tk-d29aa789317aa6145c2253e4f2d60e1084add2a2.zip tk-d29aa789317aa6145c2253e4f2d60e1084add2a2.tar.gz tk-d29aa789317aa6145c2253e4f2d60e1084add2a2.tar.bz2 |
* 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).
FossilOrigin-Name: 705ae8694d954cb8af74839ed06884c4a99e5a1a
Diffstat (limited to 'library/text.tcl')
-rw-r--r-- | library/text.tcl | 17 |
1 files changed, 11 insertions, 6 deletions
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] |