Oct-18-2016, 07:41 PM
I tossed this together to give you an example of one way it can be done. Basically, you find out the current index, and repeatedly increment that until the index points somewhere that isn't currently visible, and then move the widget to display that index.
from tkinter import scrolledtext as st from tkinter import constants as const def scroll_textbox(elem): # get the current index current = float(elem.index(const.CURRENT)) new = current # keep incrementing the index until it's not visible while elem.bbox(new): new += 1 # make sure the new index is visible elem.see(new) # move the index again in 250ms elem.after(250, lambda: scroll_textbox(elem)) if __name__ == "__main__": # a little setup to demonstrate... stext = st.ScrolledText(bg='white', height=10) # kick off our callback stext.after(1000, lambda: scroll_textbox(stext)) # shove a large amount of text in there stext.insert(const.END, ''' here's a very large block of text. it just keeps going... ''' + ('...and going...\n\n'*100)) stext.pack(fill=const.BOTH, side=const.LEFT, expand=True) stext.focus_set() stext.mainloop()