From: Charlie Moad <cwmoad@gm...> - 2005-11-22 19:32:49
Can anybody think of a good way to disable a widget (specifically
SpanSelector) during plot interaction from the toolbar? It seems
wrong when you are panning and the SpanSelector is triggering over and
over. Is there a trivial way to detect the state of the toolbar?
From: John Hunter <jdhunter@ac...> - 2005-11-26 03:37:12
>>>>> "Charlie" =3D=3D Charlie Moad <cwmoad@...> 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
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.
Charlie> Thanks, 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> Matplotlib-users mailing list