Tk mouse wheel events?

Edward K. Ream edream at
Thu Aug 15 18:04:29 CEST 2002

I am trying to get a binding to fire when the mouse wheel moves.  Vertical
scrolling is handled automatically by the Tk.Text widget, and I would like
to scroll a canvas.  The canvas is in a toplevel that includes Text widgets.

>From a Google search it appears that Button-4 and Button-5 events might do
the job. I don't see this documented on the Tk man pages though.

The following doesn't seem ever to call the event handlers, no matter what
kind of widget is used:


Does anyone have any advice or example code?  Thanks!

Edward K. Ream   email:  edream at
Leo: Literate Editor with Outlines

More information about the Python-list mailing list