diff options
author | treectrl <treectrl> | 2005-11-16 23:39:06 (GMT) |
---|---|---|
committer | treectrl <treectrl> | 2005-11-16 23:39:06 (GMT) |
commit | 135af9fa0bc1d74ae9c9b19e8c102fce1ecab02e (patch) | |
tree | ee1bc6392ac661613ed835472e9654477a16243c | |
parent | 369e07e6b8ea5c9914bed4cbec92163bf5c77543 (diff) | |
download | tktreectrl-135af9fa0bc1d74ae9c9b19e8c102fce1ecab02e.zip tktreectrl-135af9fa0bc1d74ae9c9b19e8c102fce1ecab02e.tar.gz tktreectrl-135af9fa0bc1d74ae9c9b19e8c102fce1ecab02e.tar.bz2 |
Add mousewheel support to OSX. [Patch 1338259]
-rw-r--r-- | library/treectrl.tcl | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/library/treectrl.tcl b/library/treectrl.tcl index f6d1595..eb33ad7 100644 --- a/library/treectrl.tcl +++ b/library/treectrl.tcl @@ -1,4 +1,4 @@ -# RCS: @(#) $Id: treectrl.tcl,v 1.20 2005/09/15 04:40:15 treectrl Exp $ +# RCS: @(#) $Id: treectrl.tcl,v 1.21 2005/11/16 23:39:06 treectrl Exp $ bind TreeCtrl <Motion> { TreeCtrl::CursorCheck %W %x %y @@ -169,11 +169,7 @@ if {$tcl_platform(platform) eq "windows"} { # someone could use the "event generate" command to produce one # on other platforms. -bind TreeCtrl <MouseWheel> { - %W yview scroll [expr {- (%D / 120) * 4}] units -} - -if {[string equal "unix" $tcl_platform(platform)]} { +if {[string equal "x11" [tk windowingsystem]]} { # 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: @@ -188,6 +184,14 @@ if {[string equal "unix" $tcl_platform(platform)]} { %W yview scroll 5 units } } +} elseif {[string equal [tk windowingsystem] "aqua"]} { + bind TreeCtrl <MouseWheel> { + %W yview scroll [expr {- (%D)}] units + } +} else { + bind TreeCtrl <MouseWheel> { + %W yview scroll [expr {- (%D / 120) * 4}] units + } } namespace eval ::TreeCtrl { |