MCPcopy Index your code
hub / github.com/python/cpython / _resize

Method _resize

Lib/turtle.py:766–779  ·  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

764 self.cv.coords(item, *newcoordlist)
765
766 def _resize(self, canvwidth=None, canvheight=None, bg=None):
767 """Resize the canvas the turtles are drawing on. Does
768 not alter the drawing window.
769 """
770 # needs amendment
771 if not isinstance(self.cv, ScrolledCanvas):
772 return self.canvwidth, self.canvheight
773 if canvwidth is canvheight is bg is None:
774 return self.cv.canvwidth, self.cv.canvheight
775 if canvwidth is not None:
776 self.canvwidth = canvwidth
777 if canvheight is not None:
778 self.canvheight = canvheight
779 self.cv.reset(canvwidth, canvheight, bg)
780
781 def _window_size(self):
782 """ 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