This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: tkinter.scrolledtext: new text is hidden after using insert()
Type: behavior Stage:
Components: Tkinter Versions: Python 3.0
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: gpolo, ringhome
Priority: normal Keywords:

Created on 2009-02-06 05:48 by ringhome, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (4)
msg81248 - (view) Author: David Schultz (ringhome) Date: 2009-02-06 05:48
I've added a "keep at bottom" option to the scrolledtext class.  This way, 
if a user wants to always see the text added via "insert()", it will be 
visible.
msg82544 - (view) Author: Guilherme Polo (gpolo) * (Python committer) Date: 2009-02-20 19:36
Do you mean something like this:

import Tkinter

def insert():
    text.insert('end', 'buh\n')
    text.see('end')
    text.after(100, insert)

text = Tkinter.Text()
text.pack(expand=True, fill='both', side='left')
vbar = Tkinter.Scrollbar(orient='vertical', command=text.yview)
vbar.pack(side='right', fill='y')
text.configure(yscrollcommand=vbar.set)
text.after(100, insert)

text.mainloop()

(or change Tkinter by tkinter to work on python 3.x)
Text.see already does what you want, can you argue why adding an option
for that would be good ?
msg82560 - (view) Author: David Schultz (ringhome) Date: 2009-02-21 05:45
Just an ignorance issue, I supposed.  I didn't realize that it was  
that simple.  Still a novice at all of the methods available.

In that case, the only advantage is in case you don't want to always  
manually set it to the end.  No good reason to change it otherwise.

On Feb 20, 2009, at 12:36 PM, Guilherme Polo wrote:

>
> Guilherme Polo <ggpolo@gmail.com> added the comment:
>
> Do you mean something like this:
>
> import Tkinter
>
> def insert():
>    text.insert('end', 'buh\n')
>    text.see('end')
>    text.after(100, insert)
>
> text = Tkinter.Text()
> text.pack(expand=True, fill='both', side='left')
> vbar = Tkinter.Scrollbar(orient='vertical', command=text.yview)
> vbar.pack(side='right', fill='y')
> text.configure(yscrollcommand=vbar.set)
> text.after(100, insert)
>
> text.mainloop()
>
> (or change Tkinter by tkinter to work on python 3.x)
> Text.see already does what you want, can you argue why adding an  
> option
> for that would be good ?
>
> ----------
> nosy: +gpolo
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue5163>
> _______________________________________
msg82564 - (view) Author: Guilherme Polo (gpolo) * (Python committer) Date: 2009-02-21 11:38
In this case I'm closing it.
History
Date User Action Args
2022-04-11 14:56:45adminsetgithub: 49413
2009-02-21 11:38:04gpolosetstatus: open -> closed
resolution: rejected
messages: + msg82564
2009-02-21 05:45:25ringhomesetmessages: + msg82560
2009-02-20 19:36:33gpolosetnosy: + gpolo
messages: + msg82544
2009-02-06 05:48:49ringhomecreate