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)
| 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): |