I am writing an application in Python using Tkinter to manage my GUI.
There is a text entry box on which I am trying to implement an autocompletion function which will bind to the Tab key.
I have bound the tab key to my entry box, but when I press tab, the program attempts to cycle between GUI elements.
How do I override this default behavior so that the GUI will only carry out my specified command on the key press?
Return 'break'
at the end of your event handler. It interrupts event propagation.
def my_tab_handler(event):
... # handle tab event
return 'break' # interrupts event propagation to default handlers
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