Tkinter tab focus traversal causes listbox selection to clear,ie,lose the selected item

G

Gerardo ARnaez

Hi.
I am writing a program to help determine coumadin regimens
to look at the code: http://sourceforge.net/projects/coumadinregimen/

The issue is that I have a variable that I want the use to select if
they don't like the default.
I have made this as a listbox widget

The rest of the gui is just entry widgets

What I noticed is that when I tab to through the entry widgets, I
lose the listbox selection: the item selected, gets unselected.

Not sure what is happening,hope I have explained it.
Thanks,
G
 
E

Eric Brunel

Hi.
I am writing a program to help determine coumadin regimens
to look at the code: http://sourceforge.net/projects/coumadinregimen/

The issue is that I have a variable that I want the use to select if
they don't like the default.
I have made this as a listbox widget

The rest of the gui is just entry widgets

What I noticed is that when I tab to through the entry widgets, I
lose the listbox selection: the item selected, gets unselected.

Not sure what is happening,hope I have explained it.

Usual tk/Tkinter pitfall: the selected item in a list box is by default
considered as a text selection. Since you can only have one text selected
at a time, selecting anything anywhere will unselect the item in the list.
To avoid this, use the exportselection=0 option when you're creating your
Listbox.
Thanks,
G

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,527
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top