From: John H. <jdh...@ac...> - 2005-11-26 03:37:12
|
>>>>> "Charlie" =3D=3D Charlie Moad <cw...@gm...> writes: Charlie> Can anybody think of a good way to disable a widget Charlie> (specifically SpanSelector) during plot interaction from Charlie> the toolbar? It seems wrong when you are panning and the Charlie> SpanSelector is triggering over and over. Is there a Charlie> trivial way to detect the state of the toolbar? I think this will require some minor tweaks to backend_bases NavigationToolbar2 and SpanSelector. You'll want to modify NavigationToolbar2 to make the mode "publicly accessible", eg a get_mode method, which returns None, 'pan/zoom', or 'zoom-to-rect' using the underlying _idPress, _idRelease, et al. Then you'll want to modify the span selector to be toolbar aware, eg, something along the lines of toolbar =3D getattr(self.ax.figure.canvas, 'toolbar') if toolbar is not None: mode =3D toolbar.get_mode() if mode is None: suppress drawing.... The getattr check is required in case someone is using the span selector in a canvas w/o the toolbar. JDH Charlie> Thanks, Charlie Charlie> ------------------------------------------------------- Charlie> This SF.Net email is sponsored by the JBoss Inc. Get Charlie> Certified Today Register for a JBoss Training Course. Charlie> Free Certification Exam for All Training Attendees Charlie> Through End of 2005. For more info visit: Charlie> http://ads.osdn.com/?ad_idv28&alloc_id=16845&op=3Dclick Charlie> _______________________________________________ Charlie> Matplotlib-users mailing list Charlie> Mat...@li... Charlie> https://lists.sourceforge.net/lists/listinfo/matplotlib-user= s |