Tkinter.Listbox: activate() doesn't work

Theodore D. Sternberg strnbrg at c532352-a.frmt1.sfba.home.com
Thu Oct 25 01:16:38 EDT 2001


How can I programmatically activate an element in a Tkinter.Listbox?
I've tried activate() but nothing happens.  For example,

import Tkinter
root=Tkinter.Tk()
lb = Tkinter.Listbox(root)
lb.insert( Tkinter.End, 'foo' )
lb.insert( Tkinter.End, 'bar' )
lb.pack()
lb.activate( 1 )

...but I don't see 'bar' now getting highlighted.  What am I doing wrong?

Ted Sternberg
Berkeley, CA



More information about the Python-list mailing list