summaryrefslogtreecommitdiffstats
path: root/library/text.tcl
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2008-12-28 23:43:14 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2008-12-28 23:43:14 (GMT)
commit54336c5070ceca45adeebef398a457aa99dd5f63 (patch)
tree6849b204934d0286023de9a56adaf14750d2cce3 /library/text.tcl
parent0a5d0843c169cfee7963b1feb685c3df23fed7c5 (diff)
downloadtk-54336c5070ceca45adeebef398a457aa99dd5f63.zip
tk-54336c5070ceca45adeebef398a457aa99dd5f63.tar.gz
tk-54336c5070ceca45adeebef398a457aa99dd5f63.tar.bz2
Corrected mouse-wheel bindings for widgets. Now Shift-wheel always scrolls the
text widget horizontally on all platforms.
Diffstat (limited to 'library/text.tcl')
-rw-r--r--library/text.tcl19
1 files changed, 18 insertions, 1 deletions
diff --git a/library/text.tcl b/library/text.tcl
index 0d9b9d2..e4bd77d 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.42 2008/11/12 16:38:13 patthoyts Exp $
+# RCS: @(#) $Id: text.tcl,v 1.43 2008/12/28 23:43:14 dkf Exp $
#
# Copyright (c) 1992-1994 The Regents of the University of California.
# Copyright (c) 1994-1997 Sun Microsystems, Inc.
@@ -471,6 +471,13 @@ if {[tk windowingsystem] eq "aqua"} {
%W yview scroll [expr {(2-%D)/3}] pixels
}
}
+ bind Text <Shift-MouseWheel> {
+ if {%D >= 0} {
+ %W xview scroll [expr {-%D/3}] pixels
+ } else {
+ %W xview scroll [expr {(2-%D)/3}] pixels
+ }
+ }
}
if {"x11" eq [tk windowingsystem]} {
@@ -488,6 +495,16 @@ if {"x11" eq [tk windowingsystem]} {
%W yview scroll 50 pixels
}
}
+ bind Text <Shift-4> {
+ if {!$tk_strictMotif} {
+ %W xview scroll -50 pixels
+ }
+ }
+ bind Text <Shift-5> {
+ if {!$tk_strictMotif} {
+ %W xview scroll 50 pixels
+ }
+ }
}
# ::tk::TextClosestGap --