I wanted to set the focus on the entry widget when the Tab key is pressed, but nothing happens.
import customtkinter as ctk
def tab(event):
entry.focus_force()
main = ctk.CTk()
main.geometry()
textbox = ctk.CTkTextbox(main)
textbox.pack(pady=10)
entry = ctk.CTkEntry(main)
entry.pack(pady=10)
textbox.bind("<Tab>", tab)
main.mainloop()
I’ve tried this with other widgets and it worked, but it didn’t work with the textbox.
New contributor
Gustavo Losch do Amaral is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.