tkinter.scrolledtext --- Scrolled text widget

源代码: Lib/tkinter/scrolledtext.py


tkinter.scrolledtext 模块提供了一个同名的类,实现了带有垂直滚动条并被配置为可以“正常运作”的文本控件 。 使用 ScrolledText 类会比直接配置一个文本控件附加滚动条要简单得多。

The text widget and scrollbar are packed together in a Frame, and the methods of the Pack, Grid and Place geometry managers are acquired from the Frame object. This allows the ScrolledText widget to be used directly to achieve most normal geometry management behavior.

如果需要更具体的控制,可以使用以下属性:

class tkinter.scrolledtext.ScrolledText(master=None, **kw)
frame

围绕文本和滚动条控件的框架。

vbar

滚动条控件。