Creating a LISTBOX Widget and applying a SCROLLBAR to it (TKINTER, PYTHON)
from tkinter import *
root = Tk()
root.geometry("1000x600")
root.title("Listbox Creating")
scrollbar = Scrollbar(root)
scrollbar.pack(side=RIGHT, fill=Y)
a = Listbox(root, yscrollcommand=scrollbar.set, height=1000)
for i in range(100):
a.insert(END, f"item{i}")
a.pack(fill=BOTH)
scrollbar.config(command=a.yview)
root.mainloop()
Comments
Post a Comment
Write something to CodeWithAbdur!