From: Neil C. <nei...@gm...> - 2008-11-03 12:00:56
|
*re-reads email* Apparently it won't teach me. Sorry for the spam. 2008/11/3 Neil Crighton <nei...@gm...>: > Thanks - sorry for posting the mailing list address instead of the the > event handling page(!). That'll teach me to email before > proof-reading... > > 2008/10/29 Ryan May <rm...@gm...>: >> Neil Crighton wrote: >>> I noticed on the event handling doc page: >>> >>> mat...@li... >>> >>> that the draggable rectangle example doesn't work in version 0.98.3. >>> The rectangle class no longer seems to have the xy property. If you >>> replace the current on_press() method in the example with the code >>> below it seem to work. >>> >>> def on_press(self, event): >>> 'on button press we will see if the mouse is over us and store >>> some data' >>> if event.inaxes != self.rect.axes: return >>> >>> contains, attrd = self.rect.contains(event) >>> if not contains: return >>> xy = self.rect.get_x(),self.rect.get_y() >>> print 'event contains', xy >>> x0, y0 = xy >>> self.press = x0, y0, event.xdata, event.ydata >>> >> >> Good catch. I checked in a slightly different version of the fix. >> >> Ryan >> >> -- >> Ryan May >> Graduate Research Assistant >> School of Meteorology >> University of Oklahoma >> > |