By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,341 Members | 1,395 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,341 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.