From: Ryan M. <rm...@gm...> - 2008-10-29 03:50:19
|
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 |