def processWheel(event): global vbar, canvas, step if event.delta > 0: # 滚轮往上滚动,放大 canvas.yview_scroll(step, 'units') else: canvas.yview_scroll(step, 'units') # 滚轮往下滚动,缩小 canvas.bind("<MouseWheel>", processWheel)
标签:processWheel,canvas,tkinter,鼠标,滚轮,yview,滚动条,step,滚动 From: https://www.cnblogs.com/lld76/p/17389455.html