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

Method screensize

Lib/turtle.py:1513–1530  ·  view source on GitHub ↗

Resize the canvas the turtles are drawing on. Optional arguments: canvwidth -- positive integer, new width of canvas in pixels canvheight -- positive integer, new height of canvas in pixels bg -- colorstring or color-tuple, new backgroundcolor If no argument

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

Source from the content-addressed store, hash-verified

1511 self._bgpicname = picname
1512
1513 def screensize(self, canvwidth=None, canvheight=None, bg=None):
1514 """Resize the canvas the turtles are drawing on.
1515
1516 Optional arguments:
1517 canvwidth -- positive integer, new width of canvas in pixels
1518 canvheight -- positive integer, new height of canvas in pixels
1519 bg -- colorstring or color-tuple, new backgroundcolor
1520 If no arguments are given, return current (canvaswidth, canvasheight)
1521
1522 Do not alter the drawing window. To observe hidden parts of
1523 the canvas use the scrollbars. (Can make visible those parts
1524 of a drawing, which were outside the canvas before!)
1525
1526 Example (for a Turtle instance named turtle):
1527 >>> turtle.screensize(2000,1500)
1528 >>> # e.g. to search for an erroneously escaped turtle ;-)
1529 """
1530 return self._resize(canvwidth, canvheight, bg)
1531
1532 def save(self, filename, *, overwrite=False):
1533 """Save the drawing as a PostScript file

Callers 1

setworldcoordinatesMethod · 0.95

Calls 1

_resizeMethod · 0.80

Tested by

no test coverage detected