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, *, use_ttk=False, **kw)¶
The keyword arguments are passed to the
Textwidget.When use_ttk is true, the surrounding frame and the scroll bar are the themed
tkinter.ttkwidgets; the default is the classictkinterwidgets.在 3.16.0a0 (unreleased) 版本发生变更: Added the use_ttk parameter.
- frame¶
围绕文本和滚动条控件的框架。
- vbar¶
滚动条控件。