Text widget wraps the text. the solution is to change the third line to

text = Text(root, wrap='none', xscrollcommand=scrollbar.set)


from Tkinter import *

root = Tk()

scrollbar = Scrollbar(root, orient=HORIZONTAL)
scrollbar.pack(side=BOTTOM, fill=X)

text = Text(root, xscrollcommand=scrollbar.set)
for i in range(1000):
text.insert(END, str(i))
text.pack(side=LEFT, fill=BOTH, expand=YES)

scrollbar.config(command=text.xview)

mainloop()


Yahoo! FareChase - Search multiple travel sites in one click.
_______________________________________________
Tkinter-discuss mailing list
Tkinter-discuss@python.org
http://mail.python.org/mailman/listinfo/tkinter-discuss

Reply via email to