Little question about Tkiner: window focus

James Stroud jstroud at ucla.edu
Mon Jun 5 17:54:37 EDT 2006


Bernard Lebel wrote:
> 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/



More information about the Python-list mailing list