MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / __init__

Method __init__

Python/Turtle.py:3570–3590  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3568 _title = _CFG["title"]
3569
3570 def __init__(self):
3571 # XXX there is no need for this code to be conditional,
3572 # as there will be only a single _Screen instance, anyway
3573 # XXX actually, the turtle demo is injecting root window,
3574 # so perhaps the conditional creation of a root should be
3575 # preserved (perhaps by passing it as an optional parameter)
3576 if _Screen._root is None:
3577 _Screen._root = self._root = _Root()
3578 self._root.title(_Screen._title)
3579 self._root.ondestroy(self._destroy)
3580 if _Screen._canvas is None:
3581 width = _CFG["width"]
3582 height = _CFG["height"]
3583 canvwidth = _CFG["canvwidth"]
3584 canvheight = _CFG["canvheight"]
3585 leftright = _CFG["leftright"]
3586 topbottom = _CFG["topbottom"]
3587 self._root.setupcanvas(width, height, canvwidth, canvheight)
3588 _Screen._canvas = self._root._getcanvas()
3589 TurtleScreen.__init__(self, _Screen._canvas)
3590 self.setup(width, height, leftright, topbottom)
3591
3592 def setup(self, width=_CFG["width"], height=_CFG["height"],
3593 startx=_CFG["leftright"], starty=_CFG["topbottom"]):

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected