[Tkinter] Listbox only takes one column

Nicolas Favre-Félix n.favrefelix at NOSPAM__free.fr
Mon Oct 27 14:01:39 EST 2003


Hello,

I have a little problem using Tkinter:
I'd like to make a interface with 3 labels on the left, facing with 3 Entry
on the right, a button below Entrys, and a Listbox under all. I could place
the Labels and Entrys, but the Listbox is just in column 0, and I want it to
take all the width (column 0 + column 1)

here is the code:
#########################
from Tkinter import *

root=Tk()

Label(root, text="Artist :").grid(row=0, column=0)
Label(root, text="Title :").grid(row=1, column=0)
Label(root, text="Album :").grid(row=2, column=0)
Label(root, text="Results :").grid(row=4, column=0)
results = Listbox(root,selectmode=SINGLE)
results.grid(row=5, column=0)


artist = Entry(root)
title = Entry(root)
album = Entry(root)

artist.grid(row=0, column=1)
title.grid(row=1, column=1)
album.grid(row=2, column=1)
but= Button(root, text="Find")
but.grid(row=3, column=1)

root.mainloop()

###############################

How can I do?

Thank you.









More information about the Python-list mailing list