码迷,mamicode.com
首页 > 其他好文 > 详细

tkinter绑定鼠标滚轮滚动事件 canvas.bind("<MouseWheel>", processWheel) 失效

时间:2017-10-24 21:00:41      阅读:532      评论:0      收藏:0      [点我收藏+]

标签:depend   ons   end   proc   bar   style   inter   tkinter   http   

其实,不同系统不一样,我的是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) 失效

标签:depend   ons   end   proc   bar   style   inter   tkinter   http   

原文地址:http://www.cnblogs.com/YouXiangLiThon/p/7725308.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!