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

Method _resize

tools/python-3.11.9-amd64/Lib/turtle.py:773–786  ·  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

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