diff options
Diffstat (limited to 'library/demos/items.tcl')
-rw-r--r-- | library/demos/items.tcl | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/library/demos/items.tcl b/library/demos/items.tcl index 5f51a90..335971b 100644 --- a/library/demos/items.tcl +++ b/library/demos/items.tcl @@ -34,6 +34,13 @@ 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" +bind $c <TouchpadScroll> { + lassign [tk::PreciseScrollDeltas %D] deltaX deltaY + if {$deltaX != 0 || $deltaY != 0} { + tk::ScrollByPixels %W $deltaX $deltaY + } +} + grid $c -in $w.frame \ -row 0 -column 0 -rowspan 1 -columnspan 1 -sticky news grid $w.frame.vscroll \ |