Add item to ListBox : ListBox : Tkinker PYTHON TUTORIALS


PYTHON TUTORIALS » Tkinker » ListBox »

 

Add item to ListBox


Add item to ListBox
from Tkinter import *
root = Tk()

scrollbar = Scrollbar(root, orient=HORIZONTAL)
scrollbar.pack(side=BOTTOM, fill=X)

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

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



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Tkinker
» ListBox