(self)
| 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"]): |
nothing calls this directly
no test coverage detected