Tkinter: listbox navigation
Tim Daneliuk
tundra at tundraware.com
Wed Nov 13 04:50:07 EST 2002
Eric Brunel wrote:
> Tim Daneliuk wrote:
>
>
>>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?
>
>
> Yep: use listbox.activate(index) and make sure your listbox keeps the
> keyboard focus (via focus_set I suppose...). To know where the active line
> is, use listbox.index(ACTIVE).
>
Many thanks - just what I was looking for...
--
------------------------------------------------------------------------------
Tim Daneliuk
tundra at tundraware.com
More information about the Python-list
mailing list