How to make Text scroll down automatically whenever text overcomes the visual area? How to make Text scroll down automatically whenever text overcomes the visual area? tkinter tkinter

How to make Text scroll down automatically whenever text overcomes the visual area?


I think this should work: every time the text is modified, this 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)