A Basic listbox with scrollbar
Python:
# Do the imports
import tkinter as tk
from tkinter import font
# Create the window
root = tk.Tk()
root.title('Tkinter listbox and scrollbar')
root.minsize(400,400)
# get available fonts
fonts = font.families()
# Create tkinter listbox widget
listbox = tk.Listbox(root)
listbox.pack(side='left', fill='both', expand=True)
# Create the scrollbar
scrollbar = tk.Scrollbar(root)
scrollbar.pack(side='right', fill='y')
# Configure the scrollbar and listbox
scrollbar.configure(command=listbox.yview)
listbox.configure(yscrollcommand=scrollbar.set)
# Insert data into the listbox
for font in fonts:
listbox.insert('end', f' {font}')
root.mainloop()