Little question about Tkiner: window focus

B

Bernard Lebel

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
 
J

James Stroud

Bernard said:
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

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

http://www.jamesstroud.com/
 

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,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top