tkinter bind command?

Dan Morrow morrow at clarityconnect.com
Sun Dec 2 21:49:54 EST 2001


My question is about binding mouse-events to a canvas.  I am creating the
canvas inside a object and
cannot call the self.canvas.bind -- it complains about "bind."  I bought
Grayson's book and it addresses
this partially on p. 239 -- where binding functions to mouse-events on a
canvas
is done through a Widget.bind(self.canvas,...) call.   Why not a
self.canvas.bind(...) call?

Page 102 has an example of the latter method for a button.  I don't
understand why it works
for a button, but not a canvas.  Does it have anything to do with creating
the
canvas inside a class/object instead of at the root level?






More information about the Python-list mailing list