将工具栏添加到画布。缩放的默认功能是缩放,如何扩展此功能?如果我重新定义缩放比例,它将使用默认功能。
class correlator_toolbar(NavigationToolbar2TkAgg):
def __init__(self,canvas_,parent_,):
global toolitems
toolitems = self.toolitems = (
('Home', 'Show home state', 'home', 'home'),
('Zoom', 'Zoom to rectangle', 'zoom_to_rect', 'zoom'),
)
NavigationToolbar2TkAgg.__init__(self,canvas_,parent_)
def zoom(self):
print 'something'