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

Discussion in 'Python' started by Gerardo ARnaez, Aug 14, 2008.

  1. 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
     
    Gerardo ARnaez, Aug 14, 2008
    #1
    1. Advertising

  2. Gerardo ARnaez

    Eric Brunel Guest

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

    On Thu, 14 Aug 2008 04:49:51 +0200, Gerardo ARnaez <>
    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+-'])"
     
    Eric Brunel, Aug 14, 2008
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Hermit Dave
    Replies:
    0
    Views:
    479
    Hermit Dave
    Jan 22, 2004
  2. =?Utf-8?B?Q2hyaXM=?=

    Submit Validation causes control to lose value

    =?Utf-8?B?Q2hyaXM=?=, Jul 19, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    451
    =?Utf-8?B?Q2hyaXM=?=
    Jul 19, 2004
  3. =?Utf-8?B?SGl0ZXNo?=

    Setting focus on the selected item in listbox

    =?Utf-8?B?SGl0ZXNo?=, May 16, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    7,100
    =?Utf-8?B?SGl0ZXNo?=
    May 17, 2006
  4. =?ISO-8859-1?Q?J=F8rgen_Hansen?=

    Tkinter Listbox looses selection on Tab

    =?ISO-8859-1?Q?J=F8rgen_Hansen?=, Jul 22, 2003, in forum: Python
    Replies:
    2
    Views:
    514
    =?ISO-8859-1?Q?J=F8rgen_Cederberg?=
    Jul 24, 2003
  5. Shea Martin
    Replies:
    1
    Views:
    132
    James Britt
    Mar 23, 2006
Loading...

Share This Page