Georg Brandl | ac6060c | 2008-05-17 18:44:45 +0000 | [diff] [blame] | 1 | :mod:`tkinter.scrolledtext` --- Scrolled Text Widget |
| 2 | ==================================================== |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 3 | |
Georg Brandl | ac6060c | 2008-05-17 18:44:45 +0000 | [diff] [blame] | 4 | .. module:: tkinter.scrolledtext |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 5 | :platform: Tk |
| 6 | :synopsis: Text widget with a vertical scroll bar. |
Terry Jan Reedy | fa089b9 | 2016-06-11 15:02:54 -0400 | [diff] [blame] | 7 | |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 8 | .. sectionauthor:: Fred L. Drake, Jr. <fdrake@acm.org> |
| 9 | |
Terry Jan Reedy | fa089b9 | 2016-06-11 15:02:54 -0400 | [diff] [blame] | 10 | **Source code:** :source:`Lib/tkinter/scrolledtext.py` |
| 11 | |
| 12 | -------------- |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 13 | |
Georg Brandl | ac6060c | 2008-05-17 18:44:45 +0000 | [diff] [blame] | 14 | The :mod:`tkinter.scrolledtext` module provides a class of the same name which |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 15 | implements a basic text widget which has a vertical scroll bar configured to do |
| 16 | the "right thing." Using the :class:`ScrolledText` class is a lot easier than |
Nikhil | 80428ed | 2019-09-10 01:55:34 -0700 | [diff] [blame^] | 17 | setting up a text widget and scroll bar directly. |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 18 | |
| 19 | The text widget and scrollbar are packed together in a :class:`Frame`, and the |
| 20 | methods of the :class:`Grid` and :class:`Pack` geometry managers are acquired |
| 21 | from the :class:`Frame` object. This allows the :class:`ScrolledText` widget to |
| 22 | be used directly to achieve most normal geometry management behavior. |
| 23 | |
| 24 | Should more specific control be necessary, the following attributes are |
| 25 | available: |
| 26 | |
Nikhil | 80428ed | 2019-09-10 01:55:34 -0700 | [diff] [blame^] | 27 | .. class:: ScrolledText(master=None, **kw) |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 28 | |
| 29 | |
Nikhil | 80428ed | 2019-09-10 01:55:34 -0700 | [diff] [blame^] | 30 | .. attribute:: frame |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 31 | |
Nikhil | 80428ed | 2019-09-10 01:55:34 -0700 | [diff] [blame^] | 32 | The frame which surrounds the text and scroll bar widgets. |
| 33 | |
| 34 | |
| 35 | .. attribute:: vbar |
| 36 | |
| 37 | The scroll bar widget. |