How to move the scrollbar to inside the text widget

moideen50 at gmail.com moideen50 at gmail.com
Sat Jun 2 13:00:57 EDT 2018


I am a Newbie

I have this code

from tkinter import *

root = Tk()
root.geometry("1200x1000+30+30")
# width x height + x_offset + y_offset:
T = Text(root, height=10, width=100)
T.place(x=20, y=30)
for i in range(40):
   T.insert(END, "This is line %d\n" % i)

# create a vertical scrollbar to the right of the listbox
yscroll = Scrollbar(command=T.yview, orient=VERTICAL)
T.configure(yscrollcommand=yscroll.set)
yscroll.pack(side="right", fill="y", expand=False)

root.mainloop()


The srollbar is on the window frame, is there a way I can move it to inside and right edge of text area?

Thanks



More information about the Python-list mailing list