Georg Brandl | c21cd7e | 2008-05-16 17:37:53 +0000 | [diff] [blame] | 1 | :mod:`tkinter.scrolledtext` --- Scrolled Text Widget |
| 2 | ==================================================== |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 3 | |
| 4 | .. module:: ScrolledText |
Georg Brandl | c21cd7e | 2008-05-16 17:37:53 +0000 | [diff] [blame] | 5 | :synopsis: Old name for the tkinter.scrolledtext module. |
| 6 | |
| 7 | .. module:: tkinter.scrolledtext |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 8 | :platform: Tk |
| 9 | :synopsis: Text widget with a vertical scroll bar. |
| 10 | .. sectionauthor:: Fred L. Drake, Jr. <fdrake@acm.org> |
| 11 | |
Georg Brandl | c21cd7e | 2008-05-16 17:37:53 +0000 | [diff] [blame] | 12 | .. note:: |
| 13 | The :mod:`ScrolledText` module has been renamed to |
| 14 | :mod:`tkinter.scrolledtext` in Python 3.0. It is importable under both names |
| 15 | in Python 2.6 and the rest of the 2.x series. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 16 | |
Georg Brandl | c21cd7e | 2008-05-16 17:37:53 +0000 | [diff] [blame] | 17 | The :mod:`tkinter.scrolledtext` module provides a class of the same name which |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 18 | implements a basic text widget which has a vertical scroll bar configured to do |
| 19 | the "right thing." Using the :class:`ScrolledText` class is a lot easier than |
| 20 | setting up a text widget and scroll bar directly. The constructor is the same |
Georg Brandl | c21cd7e | 2008-05-16 17:37:53 +0000 | [diff] [blame] | 21 | as that of the :class:`tkinter.Text` class. |
| 22 | |
| 23 | .. versionchanged:: 2.6 |
| 24 | Renamed from ``ScrolledText``. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 25 | |
| 26 | The text widget and scrollbar are packed together in a :class:`Frame`, and the |
| 27 | methods of the :class:`Grid` and :class:`Pack` geometry managers are acquired |
| 28 | from the :class:`Frame` object. This allows the :class:`ScrolledText` widget to |
| 29 | be used directly to achieve most normal geometry management behavior. |
| 30 | |
| 31 | Should more specific control be necessary, the following attributes are |
| 32 | available: |
| 33 | |
| 34 | |
| 35 | .. attribute:: ScrolledText.frame |
| 36 | |
| 37 | The frame which surrounds the text and scroll bar widgets. |
| 38 | |
| 39 | |
| 40 | .. attribute:: ScrolledText.vbar |
| 41 | |
| 42 | The scroll bar widget. |