| 1 |
:mod:`!tkinter.scrolledtext` --- Scrolled Text Widget |
| 2 |
===================================================== |
| 3 |
|
| 4 |
.. module:: tkinter.scrolledtext |
| 5 |
:synopsis: Text widget with a vertical scroll bar. |
| 6 |
|
| 7 |
.. sectionauthor:: Fred L. Drake, Jr. <[email protected]> |
| 8 |
|
| 9 |
**Source code:** :source:`Lib/tkinter/scrolledtext.py` |
| 10 |
|
| 11 |
-------------- |
| 12 |
|
| 13 |
The :mod:`!tkinter.scrolledtext` module provides a class of the same name which |
| 14 |
implements a basic text widget which has a vertical scroll bar configured to do |
| 15 |
the "right thing." Using the :class:`ScrolledText` class is a lot easier than |
| 16 |
setting up a text widget and scroll bar directly. |
| 17 |
|
| 18 |
The text widget and scrollbar are packed together in a :class:`Frame`, and the |
| 19 |
methods of the :class:`Grid` and :class:`Pack` geometry managers are acquired |
| 20 |
from the :class:`Frame` object. This allows the :class:`ScrolledText` widget to |
| 21 |
be used directly to achieve most normal geometry management behavior. |
| 22 |
|
| 23 |
Should more specific control be necessary, the following attributes are |
| 24 |
available: |
| 25 |
|
| 26 |
.. class:: ScrolledText(master=None, **kw) |
| 27 |
|
| 28 |
|
| 29 |
.. attribute:: frame |
| 30 |
|
| 31 |
The frame which surrounds the text and scroll bar widgets. |
| 32 |
|
| 33 |
|
| 34 |
.. attribute:: vbar |
| 35 |
|
| 36 |
The scroll bar widget. |