0

So I have this simple list and scroll bar combo and I have been trying to make it stay at the bottom of the scroll bar as the text is added so it looks like the scroll bar is just to look back over the previous text.

Like in a text-based game style thing?

Here is la code:

from Tkinter import *

root = Tk()
displayscrollbar = Scrollbar(root)
scrollbar.pack( side = RIGHT, fill=Y )

display = Listbox(root, yscrollcommand = scrollbar.set )
for line in range(100):
   display.insert(END, "This is line number " + str(line))
display.pack( side = LEFT, fill = BOTH )
scrollbar.config( command = display.yview )

mainloop()
2
Contributors
4
Replies
6
Views
8 Years
Discussion Span
Last Post by kolosick.m188
0

Sorry, Is there any chance you might know how to do it with a Text widget?

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.