Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import tkinter as tk
- root=tk.Tk()
- root.geometry('100x200')
- def OnVsb(box,*args):
- box.yview(*args)
- def make_box_and_scrollbar():
- box = tk.Text(root)
- box.pack(side="left",fill="x")
- box.configure(width=10)
- vsb = tk.Scrollbar(orient="vertical")
- vsb.pack(side="left",fill="y")
- box.configure(yscrollcommand=vsb.set)
- vsb.configure(command=OnVsb(box))
- box.configure(yscrollcommand=vsb.set)
- for i in range(15):
- box.insert("end","item %s \n" % i)
- make_box_and_scrollbar()
- root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement