Tkinter: listbox navigation

Tim Daneliuk tundra at tundraware.com
Wed Nov 13 03:10:07 EST 2002


I have looked high and low but cannot find an answer to:

When I give the listbox focus, I am able to navigate around it using the
arrow keys. So, even if I have selected a particular item, I can move to
other items *which is indicated by an underlining of the currently
navigated item*.  So, at any moment in time, one item may be selected
and another underlined.

Is there a way programmatically to force the underlining to a particular
item?

I have a listbox which displays directory contents. I want to reload and
it periodically so it stays in sync with the directory - someone may
delete a file, for example. I do this with the after() method. After the
reload I want to set the navigation back to where it was before. I can
set the selection with the select_set() method, but I cannot figure out
how to get the underlining back to where it was - it is really annoying
to see the underline move back to the first list item every polling
period (1 sec)!

I cannot seem to find a complete set of docs on the various methods
and attributes of a listbox, so a pointer to this would also be
appreciated.

TIA,
------------------------------------------------------------------------------
Tim Daneliuk
tundra at tundraware.com




More information about the Python-list mailing list