473,386 Members | 1,817 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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
Jun 5 '06 #1
1 1327
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/
Jun 5 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: N/A | last post by:
Hey all, If I open a popup like this window.open('http://www.google.com', 'popup', 'width = 618, height = 425, directories = no, location = no, menubar = no, resizable = no, scrollbars = yes,...
6
by: Dave | last post by:
Hi, With this code, I thought that any 'click' with the mouse would be captured on the window level and nothing would happen, but a click on the button triggers nevertheless the function hit()....
2
by: Fred Snider | last post by:
Help! Opening a new window using the window.open( ) command works great for opening new windows and having them on top and having the focus. The window.focus command brings any existing...
9
by: Randell D. | last post by:
Folks, I'm working on a contact name/address database whereby a slimed down list is shown in the main window. When a record is selected, the complete record is displayed in a new window via a...
31
by: Benno Bös | last post by:
If I use the following construct in the frame "main" for a link to an extern site: <A HREF="http://www.any.xy" TARGET="extern"> the Browser is creating the window "extern", loading the page...
3
by: datactrl | last post by:
Hi, all When I use window.showModelessDialog() to open a window. And then on the opened window to open an another window with the same function, window.showModelessDialog(). The last opened one...
13
by: tochiromifune | last post by:
Hello The window.open method brings my window to the top only if it is new. If it's being reused, the window does not come to the foreground (with IE 6 it does). Is there a new way in...
2
by: Charles | last post by:
Is there a way to detect if a window is out of focus? Here's what I need it for: I have a web-based chat application that one of the 2 people chatting may have the chat window open or minimized....
4
by: Jason | last post by:
Hi, Here's the scenario: I have a web application that has window A and window B. A user has both window A and B open - window A is in the foreground and window B is behind it. If the...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.