(self, event)
| 1193 | |
| 1194 | @_call_with_reparented_event |
| 1195 | def _clicked(self, event): |
| 1196 | if self.ignore(event) or event.button != 1 or not self.ax.contains(event)[0]: |
| 1197 | return |
| 1198 | idxs = [ # Indices of frames and of texts that contain the event. |
| 1199 | *self._buttons.contains(event)[1]["ind"], |
| 1200 | *[i for i, text in enumerate(self.labels) if text.contains(event)[0]]] |
| 1201 | if idxs: |
| 1202 | coords = self._buttons.get_offset_transform().transform( |
| 1203 | self._buttons.get_offsets()) |
| 1204 | self.set_active( # Closest index, only looking in idxs. |
| 1205 | idxs[(((event.x, event.y) - coords[idxs]) ** 2).sum(-1).argmin()]) |
| 1206 | |
| 1207 | def on_clicked(self, func): |
| 1208 | """ |
nothing calls this directly
no test coverage detected