472,127 Members | 1,839 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,127 software developers and data experts.

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

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

Aug 14 '08 #1
1 4917
On Thu, 14 Aug 2008 04:49:51 +0200, Gerardo ARnaez <ga*****@gmail.com
wrote:
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
--
python -c "print ''.join([chr(154 - ord(c)) for c in
'U(17zX(%,5.zmz5(17l8(%,5.Z*(93-965$l7+-'])"
Aug 14 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Phil Schmidt | last post: by
3 posts views Thread by Harlin Seritt | last post: by
1 post views Thread by Jason P Opdycke [MSFT] | last post: by
2 posts views Thread by Hitesh | last post: by
reply views Thread by Svenn Bjerkem | last post: by
3 posts views Thread by Kevin Walzer | last post: by
1 post views Thread by sf | last post: by
9 posts views Thread by zdrakec | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.