这是单击按钮时的功能:
console1 = scrolledtext.ScrolledText(
master = main_frame,
wrap = WORD,
width = 50,
height = 12,
state = 'disabled'
)
def sender_start():
console1.configure(state='normal')
console1.insert('end', 'Some Text\r\n')
console1.configure(state='disabled')
添加文本时如何使其向下滚动?
在函数中添加一个see
sender_start方法。从文档那些。使用这个方法,我们确保指定的位置在屏幕上是可见的,否则它会自动滚动到想要的位置。在您的情况下,您需要指定 position
end。