| """ turtle-example-suite: |
| A simple event-driven paint program |
| - left mouse button moves turtle |
| - middle mouse button changes color |
| - right mouse button toogles betweem pen up |
| (no line drawn when the turtle moves) and |
| pen down (line is drawn). If pen up follows |
| at least two pen-down moves, the polygon that |
| includes the starting point is filled. |
| ------------------------------------------- |
| Play around by clicking into the canvas |
| using all three mouse buttons. |
| ------------------------------------------- |
| To exit press STOP button |
| ------------------------------------------- |
| def switchupdown(x=0, y=0): |
| def changecolor(x=0, y=0): |
| colors = colors[1:]+colors[:1] |
| colors=["red", "green", "blue", "yellow"] |
| onscreenclick(changecolor,2) |
| onscreenclick(switchupdown,3) |
| if __name__ == "__main__": |