Last active
April 22, 2022 19:51
-
-
Save Yagisanatode/6ccef95e75c5686474c7 to your computer and use it in GitHub Desktop.
Scrolling with inserted text using ScrolledText "yview" in tkinter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
###Tkinter Scrolling with Text### | |
'''Make text scroll to the bottom of the text box as new entries appear''' | |
from tkinter import * | |
from tkinter.scrolledtext import * | |
window = Tk() | |
window.wm_title("Scroll From Bottom") | |
TextBox = ScrolledText(window, height='10', width='45', wrap=WORD) | |
# | |
#Just adds 100 lines to the TextBox | |
count = 0 | |
while(count<100): | |
TextBox.insert(END, "The count is: " +str(count)+"\n") | |
#Pushes the scrollbar and focus of text to the end of the text input. | |
TextBox.yview(END) | |
count += 1 | |
TextBox.pack() | |
window = mainloop() | |
thanks! I shear it from google :D ||| Спасибо! Я искал это в google :D
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
very useful