[Tkinter-discuss] Setting the items of a listbox with new technique in TK 8.3
Sunburned Surveyor
sunburned.surveyor at gmail.com
Mon Jan 25 03:14:16 CET 2010
Jeff,
I'm sure that was the problem. Thanks for the quick response and for your help.
The Sunburned Surveyor
On Sun, Jan 24, 2010 at 6:13 PM, Jeff Epler <jepler at unpythonic.net> wrote:
> The listvariable, textvariable and so forth have to be Tkinter
> variables, not Python variables.
>
> The following program worked for me in
>>>> Tkinter._tkinter.TK_VERSION; sys.version
> '8.5'
> '2.6.4 (r264:75706, Dec 7 2009, 18:43:55) \n[GCC 4.4.1]'
>
> #!/usr/bin/python
> #----
> from Tkinter import *
>
> app = Tk()
> lv = Variable(app)
> lv.set(("Roads", "Field Observations", "Railroads", "Work Areas"))
> l = Listbox(app, listvariable=lv, height=3)
> l.pack()
> app.mainloop()
> #----
>
> Jeff
>
More information about the Tkinter-discuss
mailing list