Parameters ---------- s : str The text to be displayed. textprops : dict, default: {} Dictionary of keyword parameters to be passed to the `.Text` instance in the TextArea. multilinebaseline : bool, default: False
(self, s,
*,
textprops=None,
multilinebaseline=False,
)
| 716 | """ |
| 717 | |
| 718 | def __init__(self, s, |
| 719 | *, |
| 720 | textprops=None, |
| 721 | multilinebaseline=False, |
| 722 | ): |
| 723 | """ |
| 724 | Parameters |
| 725 | ---------- |
| 726 | s : str |
| 727 | The text to be displayed. |
| 728 | textprops : dict, default: {} |
| 729 | Dictionary of keyword parameters to be passed to the `.Text` |
| 730 | instance in the TextArea. |
| 731 | multilinebaseline : bool, default: False |
| 732 | Whether the baseline for multiline text is adjusted so that it |
| 733 | is (approximately) center-aligned with single-line text. |
| 734 | """ |
| 735 | if textprops is None: |
| 736 | textprops = {} |
| 737 | self._text = mtext.Text(0, 0, s, **textprops) |
| 738 | super().__init__() |
| 739 | self._children = [self._text] |
| 740 | self.offset_transform = mtransforms.Affine2D() |
| 741 | self._baseline_transform = mtransforms.Affine2D() |
| 742 | self._text.set_transform(self.offset_transform + |
| 743 | self._baseline_transform) |
| 744 | self._multilinebaseline = multilinebaseline |
| 745 | |
| 746 | def set_text(self, s): |
| 747 | """Set the text of this area as a string.""" |
no test coverage detected