MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / exitonclick

Method exitonclick

tools/python-3.11.9-amd64/Lib/turtle.py:3786–3814  ·  view source on GitHub ↗

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, t

(self)

Source from the content-addressed store, hash-verified

3784 self._destroy()
3785
3786 def exitonclick(self):
3787 """Go into mainloop until the mouse is clicked.
3788
3789 No arguments.
3790
3791 Bind bye() method to mouseclick on TurtleScreen.
3792 If "using_IDLE" - value in configuration dictionary is False
3793 (default value), enter mainloop.
3794 If IDLE with -n switch (no subprocess) is used, this value should be
3795 set to True in turtle.cfg. In this case IDLE's mainloop
3796 is active also for the client script.
3797
3798 This is a method of the Screen-class and not available for
3799 TurtleScreen instances.
3800
3801 Example (for a Screen instance named screen):
3802 >>> screen.exitonclick()
3803
3804 """
3805 def exitGracefully(x, y):
3806 """Screen.bye() with two dummy-parameters"""
3807 self.bye()
3808 self.onclick(exitGracefully)
3809 if _CFG["using_IDLE"]:
3810 return
3811 try:
3812 mainloop()
3813 except AttributeError:
3814 exit(0)
3815
3816class Turtle(RawTurtle):
3817 """RawTurtle auto-creating (scrolled) canvas.

Callers

nothing calls this directly

Calls 3

mainloopFunction · 0.85
exitFunction · 0.85
onclickMethod · 0.45

Tested by

no test coverage detected