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)
| 581 | return self.cv.cget("bg") |
| 582 | |
| 583 | def _write(self, pos, txt, align, font, pencolor): |
| 584 | """Write txt at pos in canvas with specified font |
| 585 | and color. |
| 586 | Return text item and x-coord of right bottom corner |
| 587 | of text's bounding box.""" |
| 588 | x, y = pos |
| 589 | x = x * self.xscale |
| 590 | y = y * self.yscale |
| 591 | anchor = {"left":"sw", "center":"s", "right":"se" } |
| 592 | item = self.cv.create_text(x-1, -y, text = txt, anchor = anchor[align], |
| 593 | fill = pencolor, font = font) |
| 594 | x0, y0, x1, y1 = self.cv.bbox(item) |
| 595 | return item, x1-1 |
| 596 | |
| 597 | def _onclick(self, item, fun, num=1, add=None): |
| 598 | """Bind fun to mouse-click event on turtle. |
nothing calls this directly
no test coverage detected