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)
| 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""" |
nothing calls this directly
no test coverage detected