def view(self, event=None): """view event handler View the original text in a separate text viewer window. """ view_text(self.text, "Squeezed Output Viewer", self.s, modal=False, wrap='none')
def display_printer_text(self, title, printer): """Create textview for built-in constants. Built-in constants have type _sitebuiltins._Printer. The text is extracted from the built-in and then sent to a text viewer with self as the parent and title as the title of the popup. """ printer._Printer__setup() text = '\n'.join(printer._Printer__lines) self._current_textview = textview.view_text(self, title, text, _utest=self._utest)
def _command(): self.called = True self.view = tv.view_text(root, 'TITLE_TEXT', 'COMMAND', _utest=True)
def test_nowrap(self): view = tv.view_text(root, 'Title', 'test', modal=False, wrap='none') text_widget = view.viewframe.textframe.text self.assertEqual(text_widget.cget('wrap'), 'none')
def test_view_text(self): view = tv.view_text(root, 'Title', 'test text', modal=False) self.assertIsInstance(view, tv.ViewWindow) self.assertIsInstance(view.viewframe, tv.ViewFrame) view.viewframe.ok()