Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
假设我有一个名为self.txt. 我还有一个滚动条,叫做scroll.
self.txt
scroll
我已将滚动条配置为可以使用self.txt,但Text只要向其中添加文本,我就需要小部件保持向下滚动。
Text
这是可行的吗?
我认为这应该可行:每次修改文本时,都应该调用:
def modified(self, event): self.txt.see(END) # tkinter.END if you use namespaces
要捕获修改,请使用:
self.txt.bind('<<Modified>>', self.modified)