matplotlib/matplotlib — pull request #1849 by warrd (2013-03-23 14:39:42+00:00)
Title: NavigationToolbar2 refactored into NavigationBase and Toolbar2Base

In response to #1829 and #1830, I have replaced the functionality of NavigationToolbar2 into two separate classes, NavigationBase and Toolbar2Base.

All figure interactions previously handled by the toolbar class are now solely handled by NavigationBase, except for anything directly related to pressing buttons on the toolbar. This now allows, for example, keyboard shortcuts to work as expected when no toolbar is present (#1829).

All backends should sub-class both of these objects. At the moment, I have only done the QT4 backend as a proof of concept, so any architectural issues can be dealt with before making changes to the other backends.

In the QT4 backend there is a potential issue in that the NavigationQT class is not an instance of QObject, so I had to emit/listen to status bar events on the canvas object rather than itself (as had been done with NavigationToolbar2QT). Is there a more appropriate object for these events?

If the developers are happy with the implementation, I can start implementing some of the other backends in preparation for the merge..