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

Method reset

Lib/turtle.py:358–373  ·  view source on GitHub ↗

Adjust canvas and scrollbars according to given canvas size.

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

Source from the content-addressed store, hash-verified

356 self._rootwindow.bind('<Configure>', self.onResize)
357
358 def reset(self, canvwidth=None, canvheight=None, bg = None):
359 """Adjust canvas and scrollbars according to given canvas size."""
360 if canvwidth:
361 self.canvwidth = canvwidth
362 if canvheight:
363 self.canvheight = canvheight
364 if bg:
365 self.bg = bg
366 self._canvas.config(bg=bg,
367 scrollregion=(-self.canvwidth//2, -self.canvheight//2,
368 self.canvwidth//2, self.canvheight//2))
369 self._canvas.xview_moveto(0.5*(self.canvwidth - self.width + 30) /
370 self.canvwidth)
371 self._canvas.yview_moveto(0.5*(self.canvheight- self.height + 30) /
372 self.canvheight)
373 self.adjustScrolls()
374
375
376 def adjustScrolls(self):

Callers 1

__init__Method · 0.95

Calls 4

adjustScrollsMethod · 0.95
xview_movetoMethod · 0.80
yview_movetoMethod · 0.80
configMethod · 0.45

Tested by

no test coverage detected