其实,不同系统不一样,我的是Ubuntu 所以是<Button-4>   <Button-5>

见下:

来自:https://stackoverflow.com/questions/17355902/python-tkinter-binding-mousewheel-to-scrollbar

Platform differences:

  • On Windows, you bind to <MouseWheel> and you need to divide event.delta by 120 (or some other factor depending on how fast you want the scroll)
  • on OSX, you bind to <MouseWheel> and you need to use event.delta without modification
  • on X11 systems you need to bind to <Button-4> and <Button-5>, and you need to divide event.delta by 120 (or some other factor depending on how fast you want to scroll)

tkinter绑定鼠标滚轮滚动事件 canvas.bind("<MouseWheel>", processWheel) 失效的更多相关文章

  1. JS禁用和启用鼠标滚轮滚动事件

    // left: 37, up: 38, right: 39, down: 40, // spacebar: 32, pageup: 33, pagedown: 34, end: 35, home: ...

  2. 纯javaScript实现元素平滑滚动,改进前两个版本,支持鼠标滚轮滚动和点击元素滚动,滚动更顺畅

    windowScroll(id, number, distance, direction, obj) 参数介绍: 1.id:所要滚动的元素id; 2.number:滚动次数; 3.distance:每 ...

  3. 如何让DbGrid支持鼠标滚轮滚动

    如何让DbGrid支持鼠标滚轮滚动 在主窗体上加一个ApplicationEvents控件(控件在Additional面板中), 在它的OnMessage事件中加入下述代码,一切搞定-! proced ...

  4. js鼠标滚轮滚动图片切换效果

    效果体验网址:http://keleyi.com/keleyi/phtml/image/12.htm HTML文件代码: <!DOCTYPE html PUBLIC "-//W3C// ...

  5. js鼠标滑轮滚动事件绑定(兼容主流浏览器)

    /** Event handler for mouse wheel event. *鼠标滚动事件 */ var wheel = function(event) { var delta = 0; if ...

  6. tkinter中鼠标与键盘事件(十五)

    鼠标与键盘事件 import tkinter wuya = tkinter.Tk() wuya.title("wuya") wuya.geometry("300x200+ ...

  7. WPF中关于自定义控件的滚动条鼠标停留在内容上鼠标滚轮滚动无效的问题

    问题起因:在一个用户控件里放置了1个TreeView垂直顺序放置. 当用户控件中的内容超过面板大小时,滚动条会自动出现 ,但是只有当鼠标指示在右边滚动条的那一条位置时,才支持鼠标滚轴滚动. 点在控件内 ...

  8. c# dev控件 gridcontrol 数据跟随鼠标滚轮滚动也可以编辑

    在绑定书到gridControl后经常发现: 如果你设置了 this.gridView3.OptionsBehavior.Editable = false; 那数据可以跟随滚轮滚动,但如果你要复制某个 ...

  9. 问题记录:JavaFx 鼠标滑轮滚动事件监听!

    问题描述: 在listview的item里面添加鼠标拖拽排序功能.代码如下: setOnMouseDragged(event -> { //设定鼠标长按0.3秒后才可拖拽 防止误操作 isCan ...

随机推荐

  1. JS自学总结的零散知识点

    1.使用new关键字的时候后面不能接这种变量而是接一个结构constructor 例如由function引导的结构 而不是像如下这样 var car={ lunzi : 4}; 这个只是一个变量而不是 ...

  2. linux问题集

    Too many authentication failures for root (code 2) 原因:服务器可能由于装了一下安全软件导致有时用ssh远程工具登陆不了,提示太多认证失败for ro ...

  3. [C#]通过反射访问类私有成员

    参考链接: https://www.cnblogs.com/adodo1/p/4328198.html 代码如下: using System; using System.Reflection; usi ...

  4. eclipse windowbuilder palette 空白

    今天在 eclipse 上安装了 windowbuilder 插件,但是 palette 一直是空白的,不能放控件. 版本 eclipse 4.9.0, windowbuilder 1.9.0. 经过 ...

  5. spring boot 下载

  6. YARN label 特性 & 指定队列及label提交任务

    以下基于 hadoop版本 hadoop-2.8.4 给各个节点打标签 yarn rmadmin -addToClusterNodeLabels fastcpu,normal # 是否独占默认是tru ...

  7. Linux 实现与宿主机共享文件夹 Centos7

    (选用的系统 centos7) 01,添加共享目录,右键虚拟机 => 设置 => 选项 => 共享文件夹(只有在虚拟机为关机状态才能添加) 02,开机,查看当前虚拟机的共享目录 =& ...

  8. Python linux 上的管理工具 pyenv 安装, pip 使用, python项目(版本分割, 项目分割, 虚拟环境创建)

    01: 假设你有一个最小环境安装的 centos-6.x 的linux操作系统 02: 安装 git => yum -y install git 03: 安装依赖 => yum -y in ...

  9. leetcode1025

    public class Solution { public bool DivisorGame(int N) { == ) { return false; } else { return true; ...

  10. 在Ubuntu下利用Eclipse调试FFmpeg《转》

    参考原贴,其中编译命令有略微改动. 第一步:准备编译环境 #sudoapt-get update #-dev libspeex-dev libtheora-dev libtool libva-dev ...