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

Method screensize

Python/Turtle.py:1384–1401  ·  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

1382 self._bgpicname = picname
1383
1384 def screensize(self, canvwidth=None, canvheight=None, bg=None):
1385 """Resize the canvas the turtles are drawing on.
1386
1387 Optional arguments:
1388 canvwidth -- positive integer, new width of canvas in pixels
1389 canvheight -- positive integer, new height of canvas in pixels
1390 bg -- colorstring or color-tuple, new backgroundcolor
1391 If no arguments are given, return current (canvaswidth, canvasheight)
1392
1393 Do not alter the drawing window. To observe hidden parts of
1394 the canvas use the scrollbars. (Can make visible those parts
1395 of a drawing, which were outside the canvas before!)
1396
1397 Example (for a Turtle instance named turtle):
1398 >>> turtle.screensize(2000,1500)
1399 >>> # e.g. to search for an erroneously escaped turtle ;-)
1400 """
1401 return self._resize(canvwidth, canvheight, bg)
1402
1403 onscreenclick = onclick
1404 resetscreen = reset

Callers 1

setworldcoordinatesMethod · 0.95

Calls 1

_resizeMethod · 0.80

Tested by

no test coverage detected