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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Gerardo ARnaez

    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

  • Eric Brunel

    #2
    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 <garnaez@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.zmz 5(17l8(%,5.Z*(9 3-965$l7+-'])"

    Comment

    Working...