How to make the text scroll down automatically when the text overcomes the scope?

Say I have a text widget called self.txt . I also have a scrollbar called scroll .

I have configured the scroll bar to work with self.txt , but I need the Text widget to stay scrolled down whenever text is added to it.

Is this doable?

+4
source share
1 answer

I think this should work: every time the text changes, it should be called:

 def modified(self, event): self.txt.see(END) # tkinter.END if you use namespaces 

To catch the modification, use:

 self.txt.bind('<<Modified>>', self.modified) 
+6
source

Source: https://habr.com/ru/post/1489770/


All Articles