Go into mainloop until the mouse is clicked. No arguments. Bind bye() method to mouseclick on TurtleScreen. If "using_IDLE" - value in configuration dictionary is False (default value), enter mainloop. If IDLE with -n switch (no subprocess) is used, this val
(self)
| 3665 | self._destroy() |
| 3666 | |
| 3667 | def exitonclick(self): |
| 3668 | """Go into mainloop until the mouse is clicked. |
| 3669 | |
| 3670 | No arguments. |
| 3671 | |
| 3672 | Bind bye() method to mouseclick on TurtleScreen. |
| 3673 | If "using_IDLE" - value in configuration dictionary is False |
| 3674 | (default value), enter mainloop. |
| 3675 | If IDLE with -n switch (no subprocess) is used, this value should be |
| 3676 | set to True in turtle.cfg. In this case IDLE's mainloop |
| 3677 | is active also for the client script. |
| 3678 | |
| 3679 | This is a method of the Screen-class and not available for |
| 3680 | TurtleScreen instances. |
| 3681 | |
| 3682 | Example (for a Screen instance named screen): |
| 3683 | >>> screen.exitonclick() |
| 3684 | |
| 3685 | """ |
| 3686 | def exitGracefully(x, y): |
| 3687 | """Screen.bye() with two dummy-parameters""" |
| 3688 | self.bye() |
| 3689 | self.onclick(exitGracefully) |
| 3690 | if _CFG["using_IDLE"]: |
| 3691 | return |
| 3692 | try: |
| 3693 | mainloop() |
| 3694 | except AttributeError: |
| 3695 | exit(0) |
| 3696 | |
| 3697 | class Turtle(RawTurtle): |
| 3698 | """RawTurtle auto-creating (scrolled) canvas. |