Keyboard-aware Tkinter listbox?

Stephen Ferg steve at ferg.org
Wed May 15 10:07:24 EDT 2002


I've been using the Tkinter LISTBOX, but it seems to have some
limitations.  Other LISTBOX implementations that I'm familiar with
automatically sort the list of entries and support keyboard selection.
 By keyboard selection, I mean that if you had a list like this:

Andy
Bill
Bob
Robert

and pressed "b" on the keyboard, the cursor (highlight) would jump to
"Bill", and if you pressed "b" again, the cursor would jump to the
next line beginning with "b" (or "B") -- in this case, to "Bob".  If
you press "b" again, nothing happens because there are no further
entries that begin with "b".

I would like to have a Tkinter listbox that is keyboard aware in this
way.  Sorting the list before I send it to the listbox is easy.  But
making the list keyboard-aware would be a chunk of work. I've looked
at PMW (Python Megawidgets) and it doesn't seem to support this kind
of functionality, either.

So... I thought that before I try to build this myself,  I'd like to
ask if anyone knows if this has already been done?

-- Steve Ferg (steve at ferg.org)



More information about the Python-list mailing list