With python 2.7 tkinter on linux the command e.widget.tk_focusNext().focus() work fine to focus the next widget. But how i can do the opposite? I want to focus the previous widget, how?
The actual code is this:
def select(e):
if e.keysym=="Down":
e.widget.tk_focusNext().focus()
elif e.keysym=="Up":
pass
[...]
root.bind_all("<Key>",select)
The function you are looking for is tk_focusPrev().
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With