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

Method reset

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

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