Keeping focus with sequential Tkinter windows?

William McBrine wmcbrine at users.sf.net
Wed May 28 01:01:37 EDT 2008


So, basically what I'm doing is this:

window1 = Tkinter.Tk()
...
window1.destroy()
...
window2 = Tkinter.Tk()

This works well in Linux and Mac OS X (and the PyGtk equivalent works on 
all platforms), but in Windows XP, the second window comes up without 
focus. (I have to click on it to focus it.) This is true even with no 
other windows on screen. I've tried window2.focus_set(), window2.lift(), 
etc., to no avail. What's the right way to do this?

-- 
09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0 -- pass it on



More information about the Python-list mailing list