Answering my own question - the solution is to add a binding to the save
button, and prevent the event from propagating after calling new_save() by
adding 'return "break"' at the end:
def new_save(self, *args, **kwargs):
print 'save_figure pressed'
return "break"
get_current_fig_manager()
Hmm, problems with html, will try again in plain text:
I'm trying to override the behaviour of the toolbar, with partial success.
This works:
from matplotlib.backend_bases import NavigationToolbar2
home = NavigationToolbar2.home
def new_home(self, *args, **kwargs):
print 'home pressed'
I'm trying to override the behaviour of the toolbar, with partial success.
This works:
...but this doesn't:
Having actually created a figure, I can get a bound method for save_figure:
This I can override, and call my override function successfully from my
script - but pressing the save bu