MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / __init__

Method __init__

tools/python-3.11.9-amd64/Lib/turtle.py:3689–3709  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3687 _title = _CFG["title"]
3688
3689 def __init__(self):
3690 # XXX there is no need for this code to be conditional,
3691 # as there will be only a single _Screen instance, anyway
3692 # XXX actually, the turtle demo is injecting root window,
3693 # so perhaps the conditional creation of a root should be
3694 # preserved (perhaps by passing it as an optional parameter)
3695 if _Screen._root is None:
3696 _Screen._root = self._root = _Root()
3697 self._root.title(_Screen._title)
3698 self._root.ondestroy(self._destroy)
3699 if _Screen._canvas is None:
3700 width = _CFG["width"]
3701 height = _CFG["height"]
3702 canvwidth = _CFG["canvwidth"]
3703 canvheight = _CFG["canvheight"]
3704 leftright = _CFG["leftright"]
3705 topbottom = _CFG["topbottom"]
3706 self._root.setupcanvas(width, height, canvwidth, canvheight)
3707 _Screen._canvas = self._root._getcanvas()
3708 TurtleScreen.__init__(self, _Screen._canvas)
3709 self.setup(width, height, leftright, topbottom)
3710
3711 def setup(self, width=_CFG["width"], height=_CFG["height"],
3712 startx=_CFG["leftright"], starty=_CFG["topbottom"]):

Callers

nothing calls this directly

Calls 7

setupMethod · 0.95
_RootClass · 0.85
ondestroyMethod · 0.80
setupcanvasMethod · 0.80
_getcanvasMethod · 0.80
titleMethod · 0.45
__init__Method · 0.45

Tested by

no test coverage detected