summaryrefslogtreecommitdiffstats
path: root/library/listbox.tcl
diff options
context:
space:
mode:
authorhobbs <hobbs>2000-02-10 08:52:50 (GMT)
committerhobbs <hobbs>2000-02-10 08:52:50 (GMT)
commit590d429c5fcd570547336bc7ab06310f35f35c0f (patch)
tree968bc26bcdf038267ca7f4eebaeeb9b390e47e60 /library/listbox.tcl
parent6e3c3db8630f629578ea034020ae7d920aadf4ce (diff)
downloadtk-590d429c5fcd570547336bc7ab06310f35f35c0f.zip
tk-590d429c5fcd570547336bc7ab06310f35f35c0f.tar.gz
tk-590d429c5fcd570547336bc7ab06310f35f35c0f.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.
Diffstat (limited to 'library/listbox.tcl')
-rw-r--r--library/listbox.tcl19
1 files changed, 18 insertions, 1 deletions
diff --git a/library/listbox.tcl b/library/listbox.tcl
index 5c95474..cd5d6c8 100644
--- a/library/listbox.tcl
+++ b/library/listbox.tcl
@@ -3,7 +3,7 @@
# This file defines the default bindings for Tk listbox widgets
# and provides procedures that help in implementing those bindings.
#
-# RCS: @(#) $Id: listbox.tcl,v 1.9 2000/01/06 02:22:24 hobbs Exp $
+# RCS: @(#) $Id: listbox.tcl,v 1.10 2000/02/10 08:52:50 hobbs Exp $
#
# Copyright (c) 1994 The Regents of the University of California.
# Copyright (c) 1994-1995 Sun Microsystems, Inc.
@@ -183,6 +183,23 @@ bind Listbox <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 Listbox <4> {
+ if {!$tk_strictMotif} {
+ %W yview scroll -5 units
+ }
+ }
+ bind Listbox <5> {
+ if {!$tk_strictMotif} {
+ %W yview scroll 5 units
+ }
+ }
+}
+
# tkListboxBeginSelect --
#
# This procedure is typically invoked on button-1 presses. It begins