Hi!

Why this example does not work?

------------------
from tkinter import *

root=Tk()
root.geometry("400x200")
S=Scrollbar(root)
T=Text(root)
T.grid(row=0,column=0)
S.grid(row=0,column=1)
S.config(command=T.yview)
T.config(yscrollcommand=S.set)
txt="""This is a very big text
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Last line
"""
T.insert(END,txt)
mainloop()
---------------------

I would like it to work more or less like this

---------------------
from tkinter import *

root=Tk()
root.geometry("400x200")
S=Scrollbar(root)
T=Text(root)
S.pack(side=RIGHT,fill=Y)
T.pack(side=LEFT,fill=Y)
S.config(command=T.yview)
T.config(yscrollcommand=S.set)
txt="""This is a very big text
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Last line
"""
T.insert(END,txt)
mainloop()
---------------------

Thanks for any help
Paulo

-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to