tkinter.scrolledtext — Scrolled text widget

Código-fonte: Lib/tkinter/scrolledtext.py


O módulo tkinter.scrolledtext fornece uma classe com o mesmo nome que implementa um widget de texto básico que possui uma barra de rolagem vertical configurada para fazer a “coisa certa”. Usar a classe ScrolledText é muito mais fácil do que configurar um widget de texto e barra de rolagem diretamente.

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.

Se um controle mais específico for necessário, os seguintes atributos estarão disponíveis:

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

The keyword arguments are passed to the Text widget.

When use_ttk is true, the surrounding frame and the scroll bar are the themed tkinter.ttk widgets; the default is the classic tkinter widgets.

Alterado na versão 3.16.0a0 (unreleased): Added the use_ttk parameter.

frame

O quadro que envolve os widgets de barra de rolagem e texto.

vbar

O widget da barra de rolagem.