So, I have three entry widgets on my window and I want that the cursor should be there on the first entry widget, so that when the window pops up the user can directly start writing on the first entry box, without having to click on the first box and then start writing.
input1 = Entry(root)
input1.pack()
input2 = Entry(root)
input2.pack()
input3 = Entry(root)
input3.pack()
Use w.focus_set()
import tkinter as tk
root = tk.Tk()
input1 = tk.Entry(root)
input1.pack()
input1.focus_set()
input2 = tk.Entry(root)
input2.pack()
input3 = tk.Entry(root)
input3.pack()
root.mainloop()
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