Scrollbar Tkinter đóng gói container với thanh cuộn. Mặc định vertical scrollbar không cần orientation.
Gắn scrollbar dọc cho Text widget: yscrollcommand=v.set trên Text, command=text.yview trên Scrollbar.
Ví dụ
from tkinter import *
from tkinter import ttk
win = Tk()
win.geometry("700x350")
v = Scrollbar(win, orient='vertical')
v.pack(side=RIGHT, fill='y')
text = Text(win, font=("Georgia", 24), yscrollcommand=v.set)
for i in range(10):
text.insert(END, "Welcome to Tutorialspoint...\n\n")
v.config(command=text.yview)
text.pack()
win.mainloop()
Kết quả
Text widget với text dài, scrollbar dọc bên phải hoạt động khi text tràn.

Quan trọng: Cần link 2 chiều: text.config(yscrollcommand=scrollbar.set) và scrollbar.config(command=text.yview). Ngang: xscrollcommand + command=text.xview.