Little question about Tkiner: window focus

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bernard Lebel

    #1

    Little question about Tkiner: window focus

    Hello,

    I have this Tkinter window that when you click on a certain button,
    another instance of Tk is created, and thus a new windows is spawned.
    That second windows holds a few widgets to browse files and
    directories.

    Now, as soon as I start browsing files and directories, the first
    window comes back in focus. I have to click the second window to put
    the focus back there.

    My question is: is there a way to force the focus of a given Tk
    instance? I'm using the Toplevel widget to create those second
    windows. I have looked into the "takefocus" option, but doesn't seem
    to have any effect.

    I'm using Python 2.4 on Windows XP Pro SP1.


    Thanks
    Bernard
  • James Stroud

    #2
    Re: Little question about Tkiner: window focus

    Bernard Lebel wrote:[color=blue]
    > Hello,
    >
    > I have this Tkinter window that when you click on a certain button,
    > another instance of Tk is created, and thus a new windows is spawned.
    > That second windows holds a few widgets to browse files and
    > directories.
    >
    > Now, as soon as I start browsing files and directories, the first
    > window comes back in focus. I have to click the second window to put
    > the focus back there.
    >
    > My question is: is there a way to force the focus of a given Tk
    > instance? I'm using the Toplevel widget to create those second
    > windows. I have looked into the "takefocus" option, but doesn't seem
    > to have any effect.
    >
    > I'm using Python 2.4 on Windows XP Pro SP1.
    >
    >
    > Thanks
    > Bernard[/color]

    You should post a code snippet so we can see if there is anything amiss.

    James

    --
    James Stroud
    UCLA-DOE Institute for Genomics and Proteomics
    Box 951570
    Los Angeles, CA 90095


    Comment

    Working...