Tkinter window focusing or selecting
bob at passcal.nmt.edu
Mon Sep 4 22:52:03 CEST 2006
I have a program with many "forms" (Toplevel windows with entry fields).
Sometimes when I .deiconify() and .lift() a form that is a child of another
form, but that just got buried under other forms it comes up 'not active'
(dimmed). I have to click on the title bar (or anywhere in the window)
before I can start entering stuff into the entry fields. It doesn't seem to
happen all of the time, which I don't understand. Doing a .focus_set()
after the .lift() fixes it, but then Tkinter loses track of which entry
field the cursor was in when the window got covered up. Is there something
else I should be calling after the .deiconify() and .lift() to make sure the
window get 'activated' (or what ever that state is)? This is on Linux at
More information about the Python-list