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

Method _resize

Python/Turtle.py:671–684  ·  view source on GitHub ↗

Resize the canvas the turtles are drawing on. Does not alter the drawing window.

(self, canvwidth=None, canvheight=None, bg=None)

Source from the content-addressed store, hash-verified

669 self.cv.coords(item, *newcoordlist)
670
671 def _resize(self, canvwidth=None, canvheight=None, bg=None):
672 """Resize the canvas the turtles are drawing on. Does
673 not alter the drawing window.
674 """
675 # needs amendment
676 if not isinstance(self.cv, ScrolledCanvas):
677 return self.canvwidth, self.canvheight
678 if canvwidth is canvheight is bg is None:
679 return self.cv.canvwidth, self.cv.canvheight
680 if canvwidth is not None:
681 self.canvwidth = canvwidth
682 if canvheight is not None:
683 self.canvheight = canvheight
684 self.cv.reset(canvwidth, canvheight, bg)
685
686 def _window_size(self):
687 """ Return the width and height of the turtle window.

Callers 1

screensizeMethod · 0.80

Calls 1

resetMethod · 0.45

Tested by

no test coverage detected