blob: d20365baa38690a084a3eaba4a31497f9a01c49d [file] [log] [blame]
Georg Brandlac6060c2008-05-17 18:44:45 +00001:mod:`tkinter.scrolledtext` --- Scrolled Text Widget
2====================================================
Georg Brandl116aa622007-08-15 14:28:22 +00003
Georg Brandlac6060c2008-05-17 18:44:45 +00004.. module:: tkinter.scrolledtext
Georg Brandl116aa622007-08-15 14:28:22 +00005 :platform: Tk
6 :synopsis: Text widget with a vertical scroll bar.
Terry Jan Reedyfa089b92016-06-11 15:02:54 -04007
Georg Brandl116aa622007-08-15 14:28:22 +00008.. sectionauthor:: Fred L. Drake, Jr. <fdrake@acm.org>
9
Terry Jan Reedyfa089b92016-06-11 15:02:54 -040010**Source code:** :source:`Lib/tkinter/scrolledtext.py`
11
12--------------
Georg Brandl116aa622007-08-15 14:28:22 +000013
Georg Brandlac6060c2008-05-17 18:44:45 +000014The :mod:`tkinter.scrolledtext` module provides a class of the same name which
Georg Brandl116aa622007-08-15 14:28:22 +000015implements a basic text widget which has a vertical scroll bar configured to do
16the "right thing." Using the :class:`ScrolledText` class is a lot easier than
Nikhil80428ed2019-09-10 01:55:34 -070017setting up a text widget and scroll bar directly.
Georg Brandl116aa622007-08-15 14:28:22 +000018
19The text widget and scrollbar are packed together in a :class:`Frame`, and the
20methods of the :class:`Grid` and :class:`Pack` geometry managers are acquired
21from the :class:`Frame` object. This allows the :class:`ScrolledText` widget to
22be used directly to achieve most normal geometry management behavior.
23
24Should more specific control be necessary, the following attributes are
25available:
26
Nikhil80428ed2019-09-10 01:55:34 -070027.. class:: ScrolledText(master=None, **kw)
Georg Brandl116aa622007-08-15 14:28:22 +000028
29
Nikhil80428ed2019-09-10 01:55:34 -070030 .. attribute:: frame
Georg Brandl116aa622007-08-15 14:28:22 +000031
Nikhil80428ed2019-09-10 01:55:34 -070032 The frame which surrounds the text and scroll bar widgets.
33
34
35 .. attribute:: vbar
36
37 The scroll bar widget.