turtle: add RawTurtle.screens (#6594)

This commit is contained in:
Shantanu
2021-12-15 23:55:09 -08:00
committed by GitHub
parent 1b80461b96
commit 7103b0be2d
2 changed files with 5 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
from tkinter import Canvas, PhotoImage
from tkinter import Canvas, Frame, PhotoImage
from typing import Any, Callable, Dict, Sequence, Tuple, TypeVar, Union, overload
# Note: '_Color' is the alias we use for arguments and _AnyColor is the
@@ -18,6 +18,8 @@ _PolygonCoords = Sequence[Tuple[float, float]]
# Vec2D is actually a custom subclass of 'tuple'.
Vec2D = Tuple[float, float]
class ScrolledCanvas(Frame): ...
class TurtleScreenBase(object):
cv: Canvas
canvwidth: int
@@ -206,6 +208,7 @@ class TPen(object):
_T = TypeVar("_T")
class RawTurtle(TPen, TNavigator):
screens: list[ScrolledCanvas | Canvas | TurtleScreen]
def __init__(
self, canvas: Canvas | TurtleScreen | None = ..., shape: str = ..., undobuffersize: int = ..., visible: bool = ...
) -> None: ...