Tracking validity in tkinter widget

Bob van der Poel bvdpoel at kootenay.com
Thu Oct 17 22:31:17 EDT 2002


I have a nice little bargraph widget which can be updated via the mouse.
Basically, what I have is:

	Code to create the widget... a rectangle on a canvas
	2 bindings:

		bind.mycanvas("<B1-Motion>", lambda e, t=t: self.motion(e, t) )
		bind.mycanvas("<1>", lambda e, t=t: self.motion(e, t) )

	And later, the motion function which grabs the y event value, and
updates the size of the rectangle.

So, far all works nicely. My problem is that if the mouse button is
pressed and I leave the area of the rectangle canvas the updates
continue. I suppose that I can add code to check for valid ranges of x
and y, but sort of think that tkinter should be doing that for me. Am I
missing something?

-- 
Bob van der Poel ** Wynndel, British Columbia, CANADA **
EMAIL: bvdpoel at kootenay.com
WWW:   http://www.kootenay.com/~bvdpoel




More information about the Python-list mailing list