summaryrefslogtreecommitdiffstats
path: root/library/text.tcl
diff options
context:
space:
mode:
authorhobbs <hobbs@noemail.net>2000-02-10 08:52:49 (GMT)
committerhobbs <hobbs@noemail.net>2000-02-10 08:52:49 (GMT)
commitbe3337156367a5f02b03d01d1e0ac619334c004f (patch)
tree968bc26bcdf038267ca7f4eebaeeb9b390e47e60 /library/text.tcl
parentdf03cc2cc459fb8477aac8d7b7b7a9c74294cddf (diff)
downloadtk-be3337156367a5f02b03d01d1e0ac619334c004f.zip
tk-be3337156367a5f02b03d01d1e0ac619334c004f.tar.gz
tk-be3337156367a5f02b03d01d1e0ac619334c004f.tar.bz2
* library/listbox.tcl:
* library/text.tcl: added support for <4> and <5> for mousewheel style scrolling on Unix for mice that map to these buttons. FossilOrigin-Name: b344260e3cf0f0d10edfd9acbdc8944c410ab2a4
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 557fffa..dd660f8 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.9 2000/01/21 03:54:57 hobbs Exp $
+# RCS: @(#) $Id: text.tcl,v 1.10 2000/02/10 08:52:50 hobbs Exp $
#
# Copyright (c) 1992-1994 The Regents of the University of California.
# Copyright (c) 1994-1997 Sun Microsystems, Inc.
@@ -456,6 +456,23 @@ bind Text <MouseWheel> {
%W yview scroll [expr {- (%D / 120) * 4}] units
}
+if {[string equal "unix" $tcl_platform(platform)]} {
+ # Support for mousewheels on Linux/Unix commonly comes through mapping
+ # the wheel to the extended buttons. If you have a mousewheel, find
+ # Linux configuration info at:
+ # http://www.inria.fr/koala/colas/mouse-wheel-scroll/
+ bind Text <4> {
+ if {!$tk_strictMotif} {
+ %W yview scroll -5 units
+ }
+ }
+ bind Text <5> {
+ if {!$tk_strictMotif} {
+ %W yview scroll 5 units
+ }
+ }
+}
+
# tkTextClosestGap --
# Given x and y coordinates, this procedure finds the closest boundary
# between characters to the given coordinates and returns the index