Keeping focus with sequential Tkinter windows?

Discussion in 'Python' started by William McBrine, May 28, 2008.

  1. 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
    William McBrine, May 28, 2008
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Joshua Bronson

    New Tkinter windows don't get focus on OS X

    Joshua Bronson, Sep 10, 2009, in forum: Python
    Replies:
    8
    Views:
    572
    Joshua Bronson
    Sep 15, 2009
  2. Josh Grameson

    Keeping Cells from getting Focus?

    Josh Grameson, May 9, 2006, in forum: ASP .Net Datagrid Control
    Replies:
    3
    Views:
    99
    Eliyahu Goldin
    May 9, 2006
  3. Replies:
    6
    Views:
    102
    Randy Webb
    May 30, 2006
  4. Replies:
    0
    Views:
    140
  5. Roger
    Replies:
    3
    Views:
    311
Loading...

Share This Page