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

Method _write

tools/python-3.11.9-amd64/Lib/turtle.py:587–599  ·  view source on GitHub ↗

Write txt at pos in canvas with specified font and color. Return text item and x-coord of right bottom corner of text's bounding box.

(self, pos, txt, align, font, pencolor)

Source from the content-addressed store, hash-verified

585 return self.cv.cget("bg")
586
587 def _write(self, pos, txt, align, font, pencolor):
588 """Write txt at pos in canvas with specified font
589 and color.
590 Return text item and x-coord of right bottom corner
591 of text's bounding box."""
592 x, y = pos
593 x = x * self.xscale
594 y = y * self.yscale
595 anchor = {"left":"sw", "center":"s", "right":"se" }
596 item = self.cv.create_text(x-1, -y, text = txt, anchor = anchor[align],
597 fill = pencolor, font = font)
598 x0, y0, x1, y1 = self.cv.bbox(item)
599 return item, x1-1
600
601## def _dot(self, pos, size, color):
602## """may be implemented for some other graphics toolkit"""

Callers

nothing calls this directly

Calls 2

create_textMethod · 0.80
bboxMethod · 0.45

Tested by

no test coverage detected