mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
Improve turtle callbacks (#8200)
This commit is contained in:
@@ -221,10 +221,10 @@ class TurtleScreen(TurtleScreenBase):
|
||||
def window_height(self) -> int: ...
|
||||
def getcanvas(self) -> Canvas: ...
|
||||
def getshapes(self) -> list[str]: ...
|
||||
def onclick(self, fun: Callable[[float, float], Any], btn: int = ..., add: Any | None = ...) -> None: ...
|
||||
def onkey(self, fun: Callable[[], Any], key: str) -> None: ...
|
||||
def onclick(self, fun: Callable[[float, float], object], btn: int = ..., add: Any | None = ...) -> None: ...
|
||||
def onkey(self, fun: Callable[[], object], key: str) -> None: ...
|
||||
def listen(self, xdummy: float | None = ..., ydummy: float | None = ...) -> None: ...
|
||||
def ontimer(self, fun: Callable[[], Any], t: int = ...) -> None: ...
|
||||
def ontimer(self, fun: Callable[[], object], t: int = ...) -> None: ...
|
||||
@overload
|
||||
def bgpic(self, picname: None = ...) -> str: ...
|
||||
@overload
|
||||
@@ -238,7 +238,7 @@ class TurtleScreen(TurtleScreenBase):
|
||||
resetscreen = reset
|
||||
clearscreen = clear
|
||||
addshape = register_shape
|
||||
def onkeypress(self, fun: Callable[[], Any], key: str | None = ...) -> None: ...
|
||||
def onkeypress(self, fun: Callable[[], object], key: str | None = ...) -> None: ...
|
||||
onkeyrelease = onkey
|
||||
|
||||
class TNavigator:
|
||||
@@ -409,9 +409,9 @@ class RawTurtle(TPen, TNavigator):
|
||||
def getscreen(self) -> TurtleScreen: ...
|
||||
def getturtle(self: Self) -> Self: ...
|
||||
getpen = getturtle
|
||||
def onclick(self, fun: Callable[[float, float], Any], btn: int = ..., add: bool | None = ...) -> None: ...
|
||||
def onrelease(self, fun: Callable[[float, float], Any], btn: int = ..., add: bool | None = ...) -> None: ...
|
||||
def ondrag(self, fun: Callable[[float, float], Any], btn: int = ..., add: bool | None = ...) -> None: ...
|
||||
def onclick(self, fun: Callable[[float, float], object], btn: int = ..., add: bool | None = ...) -> None: ...
|
||||
def onrelease(self, fun: Callable[[float, float], object], btn: int = ..., add: bool | None = ...) -> None: ...
|
||||
def ondrag(self, fun: Callable[[float, float], object], btn: int = ..., add: bool | None = ...) -> None: ...
|
||||
def undo(self) -> None: ...
|
||||
turtlesize = shapesize
|
||||
|
||||
@@ -490,10 +490,10 @@ def window_width() -> int: ...
|
||||
def window_height() -> int: ...
|
||||
def getcanvas() -> Canvas: ...
|
||||
def getshapes() -> list[str]: ...
|
||||
def onclick(fun: Callable[[float, float], Any], btn: int = ..., add: Any | None = ...) -> None: ...
|
||||
def onkey(fun: Callable[[], Any], key: str) -> None: ...
|
||||
def onclick(fun: Callable[[float, float], object], btn: int = ..., add: Any | None = ...) -> None: ...
|
||||
def onkey(fun: Callable[[], object], key: str) -> None: ...
|
||||
def listen(xdummy: float | None = ..., ydummy: float | None = ...) -> None: ...
|
||||
def ontimer(fun: Callable[[], Any], t: int = ...) -> None: ...
|
||||
def ontimer(fun: Callable[[], object], t: int = ...) -> None: ...
|
||||
@overload
|
||||
def bgpic(picname: None = ...) -> str: ...
|
||||
@overload
|
||||
@@ -508,7 +508,7 @@ resetscreen = reset
|
||||
clearscreen = clear
|
||||
addshape = register_shape
|
||||
|
||||
def onkeypress(fun: Callable[[], Any], key: str | None = ...) -> None: ...
|
||||
def onkeypress(fun: Callable[[], object], key: str | None = ...) -> None: ...
|
||||
|
||||
onkeyrelease = onkey
|
||||
|
||||
@@ -680,8 +680,8 @@ def getturtle() -> Turtle: ...
|
||||
|
||||
getpen = getturtle
|
||||
|
||||
def onrelease(fun: Callable[[float, float], Any], btn: int = ..., add: Any | None = ...) -> None: ...
|
||||
def ondrag(fun: Callable[[float, float], Any], btn: int = ..., add: Any | None = ...) -> None: ...
|
||||
def onrelease(fun: Callable[[float, float], object], btn: int = ..., add: Any | None = ...) -> None: ...
|
||||
def ondrag(fun: Callable[[float, float], object], btn: int = ..., add: Any | None = ...) -> None: ...
|
||||
def undo() -> None: ...
|
||||
|
||||
turtlesize = shapesize
|
||||
|
||||
Reference in New Issue
Block a user