@@ -3405,17 +3405,15 @@ def add_tools(self, tools):
34053405        ---------- 
34063406        tools : List 
34073407            List in the form 
3408-             [[group1, [(Tool1, name1), (Tool2, name2) ...]][group2...]] 
3409-             where group1 is the name of the group where the 
3410-             Tool1, Tool2... are going to be added, and name1, name2... are the 
3411-             names of the tools 
3408+             [(Tool1, name1), (Tool2, name2) ...] 
3409+             where Tool1, name1 represent the tool, and the respective name 
3410+             of the tool which gets used as an id. 
34123411        """ 
34133412
3414-         for  group , grouptools  in  tools :
3415-             for  position , tool  in  enumerate (grouptools ):
3416-                 self .add_tool (tool [1 ], tool [0 ], group , position )
3413+         for  tool , name  in  tools :
3414+             self .add_tool (name , tool )
34173415
3418-     def  add_tool (self , name , tool ,  group = None ,  position = None ):
3416+     def  add_tool (self , name , tool ):
34193417        """Add tool to `NavigationBase` 
34203418
34213419        Add a tool to the tools controlled by Navigation 
@@ -3430,10 +3428,6 @@ def add_tool(self, name, tool, group=None, position=None):
34303428            Name of the tool, treated as the ID, has to be unique 
34313429        tool : string or `matplotlib.backend_tools.ToolBase` derived class 
34323430            Reference to find the class of the Tool to be added 
3433-         group: String 
3434-             Group to position the tool in 
3435-         position : int or None (default) 
3436-             Position within its group in the toolbar, if None, it goes at the end 
34373431        """ 
34383432
34393433        tool_cls  =  self ._get_cls_to_instantiate (tool )
@@ -3459,14 +3453,11 @@ def add_tool(self, name, tool, group=None, position=None):
34593453            else :
34603454                self ._toggled .setdefault (tool_cls .radio_group , None )
34613455
3462-         self ._tool_added_event (self ._tools [name ],  group ,  position )
3456+         self ._tool_added_event (self ._tools [name ])
34633457
3464-     def  _tool_added_event (self , tool ,  group ,  position ):
3458+     def  _tool_added_event (self , tool ):
34653459        s  =  'tool_added_event' 
3466-         event  =  ToolEvent (s ,
3467-                           self ,
3468-                           tool ,
3469-                           data = {'group' : group , 'position' : position })
3460+         event  =  ToolEvent (s , self , tool )
34703461        self ._callbacks .process (s , event )
34713462
34723463    def  _handle_toggle (self , tool , sender , canvasevent , data ):
@@ -3606,7 +3597,6 @@ def __init__(self, navigation):
36063597        self .navigation  =  navigation 
36073598
36083599        self .navigation .nav_connect ('tool_message_event' , self ._message_cbk )
3609-         self .navigation .nav_connect ('tool_added_event' , self ._add_tool_cbk )
36103600        self .navigation .nav_connect ('tool_removed_event' ,
36113601                                    self ._remove_tool_cbk )
36123602
@@ -3624,18 +3614,31 @@ def _tool_triggered_cbk(self, event):
36243614
36253615        self .toggle_toolitem (event .tool .name )
36263616
3627-     def  _add_tool_cbk (self , event ):
3628-         """Captures 'tool_added_event' and adds the tool to the toolbar""" 
3629-         image  =  self ._get_image_filename (event .tool .image )
3630-         toggle  =  getattr (event .tool , 'toggled' , None ) is  not None 
3631-         self .add_toolitem (event .tool .name ,
3632-                           event .data ['group' ],
3633-                           event .data ['position' ],
3634-                           image ,
3635-                           event .tool .description ,
3636-                           toggle )
3617+     def  add_tools (self , tools ):
3618+         """ Add multiple tools to `Navigation` 
3619+ 
3620+         Parameters 
3621+         ---------- 
3622+         tools : List 
3623+             List in the form 
3624+             [[group1, [name1, name2 ...]][group2...]] 
3625+             where group1 is the name of the group where the 
3626+             Tool1, Tool2... are going to be added, and name1, name2... are the 
3627+             names of the tools 
3628+         """ 
3629+ 
3630+         for  group , grouptools  in  tools :
3631+             for  position , tool  in  enumerate (grouptools ):
3632+                 self .add_tool (self .navigation .get_tool (tool ), group , position )
3633+ 
3634+     def  add_tool (self , tool , group , position ):
3635+         """Adds a tool to the toolbar""" 
3636+         image  =  self ._get_image_filename (tool .image )
3637+         toggle  =  getattr (tool , 'toggled' , None ) is  not None 
3638+         self .add_toolitem (tool .name , group , position , image ,
3639+                                             tool .description , toggle )
36373640        if  toggle :
3638-             self .navigation .nav_connect ('tool_trigger_%s'  %  event . tool .name ,
3641+             self .navigation .nav_connect ('tool_trigger_%s'  %  tool .name ,
36393642                                        self ._tool_triggered_cbk )
36403643
36413644    def  _remove_tool_cbk (self , event ):
0 commit comments