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

Popular posts from this blog

Quotation marks to wrap an element in HTML

What is the difference between iostream and iostream.h in cpp?

The Basic Structure of a Full-Stack Web App