diff options
Diffstat (limited to 'library/demos')
-rw-r--r-- | library/demos/items.tcl | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/library/demos/items.tcl b/library/demos/items.tcl index 5f51a90..bdd2cc2 100644 --- a/library/demos/items.tcl +++ b/library/demos/items.tcl @@ -34,6 +34,14 @@ canvas $c -scrollregion {0c 0c 30c 24c} -width 15c -height 10c \ ttk::scrollbar $w.frame.vscroll -command "$c yview" ttk::scrollbar $w.frame.hscroll -orient horizontal -command "$c xview" +#Touchpad scrolling +bind $c <Control-MouseWheel> { + lassign [tk::PreciseScrollDeltas %D] deltaX deltaY + if {$deltaX != 0 || $deltaY != 0} { + tk::CanvasScrollByPixels %W $deltaX $deltaY + } +} + grid $c -in $w.frame \ -row 0 -column 0 -rowspan 1 -columnspan 1 -sticky news grid $w.frame.vscroll \ |