MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / _get_tool_pos

Method _get_tool_pos

lib/matplotlib/backends/backend_wx.py:1211–1220  ·  view source on GitHub ↗

Find the position (index) of a wx.ToolBarToolBase in a ToolBar. ``ToolBar.GetToolPos`` is not useful because wx assigns the same Id to all Separators and StretchableSpaces.

(self, tool)

Source from the content-addressed store, hash-verified

1209 self._groups = {} # Mapping of groups to the separator after them.
1210
1211 def _get_tool_pos(self, tool):
1212 """
1213 Find the position (index) of a wx.ToolBarToolBase in a ToolBar.
1214
1215 ``ToolBar.GetToolPos`` is not useful because wx assigns the same Id to
1216 all Separators and StretchableSpaces.
1217 """
1218 pos, = (pos for pos in range(self.ToolsCount)
1219 if self.GetToolByPos(pos) == tool)
1220 return pos
1221
1222 def add_toolitem(self, name, group, position, image_file, description,
1223 toggle):

Callers 1

add_toolitemMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected