summaryrefslogtreecommitdiffstats
path: root/library/scrlbar.tcl
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-08-18 20:42:57 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-08-18 20:42:57 (GMT)
commit452f3387dfdfe45cb1fc59b28657e5111a2778d8 (patch)
tree2963a8cef29c683ccc7d3ef33fc5ea2880230d88 /library/scrlbar.tcl
parentc0c401e9d4e7565e3d5b2adda77fe939fd766ee6 (diff)
parentef0195454b1d958bcad88274c0246d0ac81b781c (diff)
downloadtk-452f3387dfdfe45cb1fc59b28657e5111a2778d8.zip
tk-452f3387dfdfe45cb1fc59b28657e5111a2778d8.tar.gz
tk-452f3387dfdfe45cb1fc59b28657e5111a2778d8.tar.bz2
Merge 8.6. Also add &lt;6&gt; and &lt;7&gt; bindings for X11, where appropriate
Diffstat (limited to 'library/scrlbar.tcl')
-rw-r--r--library/scrlbar.tcl60
1 files changed, 28 insertions, 32 deletions
diff --git a/library/scrlbar.tcl b/library/scrlbar.tcl
index 6f1caa2..0cbbc66 100644
--- a/library/scrlbar.tcl
+++ b/library/scrlbar.tcl
@@ -128,42 +128,38 @@ bind Scrollbar <<LineEnd>> {
tk::ScrollToPos %W 1
}
}
-switch [tk windowingsystem] {
- "aqua" {
- bind Scrollbar <MouseWheel> {
- tk::ScrollByUnits %W v [expr {- (%D)}]
- }
- bind Scrollbar <Option-MouseWheel> {
- tk::ScrollByUnits %W v [expr {-10 * (%D)}]
- }
- bind Scrollbar <Shift-MouseWheel> {
- tk::ScrollByUnits %W h [expr {- (%D)}]
- }
- bind Scrollbar <Shift-Option-MouseWheel> {
- tk::ScrollByUnits %W h [expr {-10 * (%D)}]
- }
+
+if {[tk windowingsystem] eq "aqua"} {
+ bind Scrollbar <MouseWheel> {
+ tk::ScrollByUnits %W v [expr {-(%D)}]
}
- "win32" {
- bind Scrollbar <MouseWheel> {
- tk::ScrollByUnits %W v [expr {- (%D / 120) * 4}]
- }
- bind Scrollbar <Shift-MouseWheel> {
- tk::ScrollByUnits %W h [expr {- (%D / 120) * 4}]
- }
+ bind Scrollbar <Option-MouseWheel> {
+ tk::ScrollByUnits %W v [expr {-10 * (%D)}]
}
- "x11" {
- bind Scrollbar <MouseWheel> {
- tk::ScrollByUnits %W v [expr {- (%D /120 ) * 4}]
- }
- bind Scrollbar <Shift-MouseWheel> {
- tk::ScrollByUnits %W h [expr {- (%D /120 ) * 4}]
- }
- bind Scrollbar <4> {tk::ScrollByUnits %W v -5}
- bind Scrollbar <5> {tk::ScrollByUnits %W v 5}
- bind Scrollbar <Shift-4> {tk::ScrollByUnits %W h -5}
- bind Scrollbar <Shift-5> {tk::ScrollByUnits %W h 5}
+ bind Scrollbar <Shift-MouseWheel> {
+ tk::ScrollByUnits %W h [expr {-(%D)}]
+ }
+ bind Scrollbar <Shift-Option-MouseWheel> {
+ tk::ScrollByUnits %W h [expr {-10 * (%D)}]
+ }
+} else {
+ bind Scrollbar <MouseWheel> {
+ tk::ScrollByUnits %W v [expr {-(%D / 30)}]
+ }
+ bind Scrollbar <Shift-MouseWheel> {
+ tk::ScrollByUnits %W h [expr {-(%D / 30)}]
}
}
+
+if {[tk windowingsystem] eq "x11"} {
+ bind Scrollbar <4> {tk::ScrollByUnits %W v -5}
+ bind Scrollbar <5> {tk::ScrollByUnits %W v 5}
+ bind Scrollbar <Shift-4> {tk::ScrollByUnits %W h -5}
+ bind Scrollbar <Shift-5> {tk::ScrollByUnits %W h 5}
+ bind Scrollbar <6> {tk::ScrollByUnits %W h -5}
+ bind Scrollbar <7> {tk::ScrollByUnits %W h 5}
+}
+
# tk::ScrollButtonDown --
# This procedure is invoked when a button is pressed in a scrollbar.
# It changes the way the scrollbar is displayed and takes actions