(self, *args)
| 186 | self.canvas.grab_focus() |
| 187 | |
| 188 | def destroy(self, *args): |
| 189 | if self._destroying: |
| 190 | # Otherwise, this can be called twice when the user presses 'q', |
| 191 | # which calls Gcf.destroy(self), then this destroy(), then triggers |
| 192 | # Gcf.destroy(self) once again via |
| 193 | # `connect("destroy", lambda *args: Gcf.destroy(self))`. |
| 194 | return |
| 195 | self._destroying = True |
| 196 | self.window.destroy() |
| 197 | self.canvas.destroy() |
| 198 | super().destroy() |
| 199 | |
| 200 | @classmethod |
| 201 | def start_main_loop(cls): |