Tkinter Listbox looses selection on Tab
jorgencederberg at hotmail.com
Thu Jul 24 08:58:53 CEST 2003
Martin Franklin wrote:
> On Tuesday 22 July 2003 19:40, Jørgen Hansen wrote:
>>I have a problem with a Listbox in Tkinter. When I tab through several
>>widgets with the tab-key, the listbox looses its selection, even
>>though it has been selected with .selection_set. The example below
>>demonstrates this. Can anyone provide me with some help on this?
>>Ps. I'm on a W2K machine with Python 2.2.2
>>from Tkinter import *
>>root = Tk()
>>colors = ['Yellow', 'Black', 'White', 'Green']
>>lb = Listbox(root)
> Try setting exportselection=0 in the Listbox construction like so:
> lb = Listbox(root, exportselection=0)
> This seems to work on my linux box.
It worked on my W2K machine too! Thanks alot. I skimmed through some
TCL/TK documentation, but I'm still somewhat puzzled over the default
But I'm sure I'll figure it out someday.
Have a nice day
More information about the Python-list