turtle.onrelease(fun, btn=1, add=None)
Parameters: |
|
---|
Bind fun to mouse-button-release events on this turtle. If fun is None
, existing bindings are removed.
>>> class MyTurtle(Turtle): ... def glow(self,x,y): ... self.fillcolor("red") ... def unglow(self,x,y): ... self.fillcolor("") ... >>> turtle = MyTurtle() >>> turtle.onclick(turtle.glow) # clicking on turtle turns fillcolor red, >>> turtle.onrelease(turtle.unglow) # releasing turns it to transparent.
Please login to continue.