当一个Tkinter列表框select被改变时得到一个callback?

当Tkinter中的TextEntry小部件发生变化时,有许多方法可以获得callback,但是我还没有findListbox的一个方法(这对我所能find的大部分事件文档都没有帮助) 。 有什么办法为此产生一个事件吗?

你可以绑定到:

 <<ListboxSelect>> 
 def onselect(evt): # Note here that Tkinter passes an event object to onselect() w = evt.widget index = int(w.curselection()[0]) value = w.get(index) print 'You selected item %d: "%s"' % (index, value) lb = Listbox(frame, name='lb') lb.bind('<<ListboxSelect>>', onselect)