matplotlib/matplotlib — pull request #724 by tonysyu (2012-02-28 03:30:36+00:00)
Title: Add AxesWidget base class to handle event activation and clean up.

* Adds `connect_event` method to connect event *and store a reference*. Additional `disconnect_events` method allows user to clean up widget. Some widgets did their own cleanup, but this makes behavior more consistent.

* Adds default `ignore` method and call it in event callbacks. Some widgets had their own `ignore` methods, but this makes behavior more consistent.

Todo:

* I think `SpanSelector.new_axes` should be removed, but may be some user's code depends on it. Right now I duplicate most of the `new_axes` code in `__init__`: If `new_axis` isn't removed, then duplication should be removed.

* `update_background` in `SpanSelector` and `RectangleSelector` don't ignore events when deactivated.