Keeping focus with sequential Tkinter windows?

W

William McBrine

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,054
Latest member
LucyCarper

Latest Threads

Top