Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # tk_basic_scrollbar.py
- from tkinter import *
- ww = 600
- hh = 600
- root = Tk()
- root.geometry(f"{ww}x{hh}")
- scrollbar = Scrollbar(root)
- scrollbar.pack(side=RIGHT, fill=Y)
- canvas1=Canvas(root, yscrollcommand=scrollbar.set, width=ww, height=hh)
- canvas1.pack()
- coord = [40, 100, 400, 600]
- arc = canvas1.create_rectangle(*coord, outline="#fb0", fill="#fb0")
- scrollbar.config(command=canvas1.yview)
- canvas1.config(scrollregion=(0, 0, 1000, 1000))
- root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement