ListBox with scroll bar : ListBox « Tkinker « Python Tutorial






ListBox with scroll bar
from Tkinter import *
root = Tk()

scrollbar = Scrollbar(root)
scrollbar.pack(side=RIGHT, fill=Y)

mylist = Listbox(root, yscrollcommand=scrollbar.set)
for line in range(100):
    mylist.insert(END, "This is line number " + str(line))
mylist.pack(side=LEFT, fill=BOTH)

scrollbar.config(command=mylist.yview)
mainloop()








18.19.ListBox
18.19.1.Add item to ListBoxAdd item to ListBox
18.19.2.ListBox with scroll barListBox with scroll bar
18.19.3.Creating a multiple selection list.Creating a multiple selection list.
18.19.4.Add item to the end of ListBoxAdd item to the end of ListBox
18.19.5.Remove the selected itemsRemove the selected items
18.19.6.Scrolled listScrolled list