autoscroll of text and scrollbar in python text box

后端 未结 2 1736
感情败类
感情败类 2020-12-19 01:56

I have a tkinter \'Text\' and \'Scrollbar\' working fine. In my program in the text window automatically lines will keep on adding. So When a new line of text is inserted an

2条回答
  •  离开以前
    2020-12-19 01:58

    Take a look at Text.see(...) method.

    TextWidget.insert(tk.END, str(new_txt))
    TextWidget.see(tk.END)
    

    I used this pattern to add (aka insert) text new_txt to my output window and scroll (see) to the bottom (tk.END)

提交回复
热议问题