[Tkinter-discuss] xscrollbar

Mohammad Tayseer m_tayseer82 at yahoo.com
Fri Nov 18 20:26:10 CET 2005


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.  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20051118/651e969a/attachment.htm


More information about the Tkinter-discuss mailing list