'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 value should be
set to True in turtle.cfg. In this case IDLE\'s mainloop
is active also for the client script.
This is a method of the Screen-class and not available for
TurtleScreen instances.
Example (for a Screen instance named screen):
>>> screen.exitonclick()'

def exitonclick(self):

    def exitGracefully(x, y):
        'Screen.bye()    with    two    dummy-parameters'
        self.bye()
    self.onclick(exitGracefully)
    if _CFG['using_IDLE']:
        return
    try:
        mainloop()
    except AttributeError:
        exit(0)
