Mar-08-2020, 05:24 PM
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
import tkinter as tk window = tk.Tk() window.title( 'Impedance simulation' ) window.geometry( '900x700' ) entry1 = tk.Entry(window,show = None ,textvariable = tk.StringVar(value = 1 )) entry2 = tk.Entry(window,show = None ,textvariable = tk.StringVar(value = 2 )) entry3 = tk.Entry(window,show = None ,textvariable = tk.StringVar(value = 3 )) entry1.pack() entry2.pack() entry3.pack() def locate(key): print (window.focus_get()) window.bind( '<Key>' , locate) window.mainloop() |
im struggling to locate the focused entry
the focus_get() only tells me it's an entry not which one
is there a way to locate the exact entry that's focused?
Thank you!!!