LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

window focus- multiple LV Windows

 

I have multiple LV Client windows (8 client windows at the moment) and each runs same or different test for RF testing ( 8 RF radios simultaniously). Normally user setup the first client (window1) and start the test and move on to the second, third and so on.. each client window has multiple text box to enter part number, serial number etc.  The issue is, once the user setup the first window and move on to the second window and entering the required PN and SN, but the first window takes over the window focus while editing the second window, so the user has to click on the second window multiple times to complete the task.

This happens when the first window trying to read client VIs ( eg, check VI version, check FAT etc) from the server. Since there are eight client windows on the screen it is hard to see which window is active. What I would like to do is to the keep the focus on the window that user selects and do not lose its focus. Need help..

0 Kudos
Message 1 of 9
(3,009 Views)

Is this within an executable or the development environment?

 

How are you calling the new subVI window?

 

Why would another window suddenly get focus unless the user clicked on it or you somehow programmtically called it into focus?  If you can figure out what is causing tha to happen, then your problem should go away.

 

Is it something like a Win7 "feature"  where just moving the mouse around the window starts highlighting various windows?

 

Eight is a lot of windows to have open at once.  Is there any reason not to hide the other windows, or somehow try to manage the user's interaction to just one or two windows at once?

0 Kudos
Message 2 of 9
(2,981 Views)

Make the active window topmost.

 

 

George Zou
0 Kudos
Message 3 of 9
(2,970 Views)

I agree with RavensFan that 8 windows is a lot. As the customer has a specific flow and doesn't need to see the rest of the windows, why not make the front panel of the other windows invisible when not in use? Or use an invisible tab container with 8 pages, like a wizard type interface?

 

Focus tends to move when performing front panel updates (like showing new data). You can try not updating graphs etc. automatically, for example after performing what is needed in the first window stop updating front panel and add a refresh button to first window so user can refresh the data.

"Wisdom comes from experience. Experience is often a result of lack of wisdom.”
― Terry Pratchett
0 Kudos
Message 4 of 9
(2,946 Views)

dsavir wrote:

 

Focus tends to move when performing front panel updates (like showing new data). You can try not updating graphs etc. automatically, for example after performing what is needed in the first window stop updating front panel and add a refresh button to first window so user can refresh the data.


dsavir: I don't believe that's true. A front panel wouldn't steal focus when updating it's front panel, otherwise it would be impossible to work with more than one visible front panel at a time. There are a multitude of example LabVIEW programs that throw up more than one interactive interface and rely on the front panel focus remaining where the operator is working.

 

As RavensFan has indicated, there must be a programmatic reason why your VIs are stealing window focus. Presumably you aren't calling the KeyFocus property on any of your controls?

 

Question: If you have 8 front panels, which one is stealing focus when you're working on, say, the sixth panel? Is it always the first panel that steals the focus? Or do the first 5 steal focus randomly between themselves?

 

If you can post some code that might help us to diagnose the source of your issue.

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 5 of 9
(2,943 Views)

Hi,

 

It might not be always true, but in my experience that is what happens. Is it likely that I also am not handling the focus correctly and that this is the default behaviour? Or specifically the type of graph used, that has this type of default focusing?

 

What does your front panel look like?

"Wisdom comes from experience. Experience is often a result of lack of wisdom.”
― Terry Pratchett
0 Kudos
Message 6 of 9
(2,937 Views)

@dsavir wrote:

 

It might not be always true, but in my experience that is what happens


I'd be very interested to see examples of this, because if you aren't specifically asking for the window focus to change (programmatically or otherwise) then it shouldn't change. I can only think of one scenario where this could occur, non programmatically, and this would require VI property changes away from the default.

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 7 of 9
(2,931 Views)

You are correct because when I tried to do this now with a simple example it didn't change focus. I need to look over our main code (I didn't program all of it) maybe some defaults were changed there to cause this behaviour. I will see if I find an example. We communicate with multiple instruments, perhaps it is the result of running dlls in the GUI thread? Could this affect the focus?

"Wisdom comes from experience. Experience is often a result of lack of wisdom.”
― Terry Pratchett
0 Kudos
Message 8 of 9
(2,926 Views)

@dsavir wrote:

You are correct because when I tried to do this now with a simple example it didn't change focus. I need to look over our main code (I didn't program all of it) maybe some defaults were changed there to cause this behaviour. I will see if I find an example. We communicate with multiple instruments, perhaps it is the result of running dlls in the GUI thread? Could this affect the focus?


DLLs in the UI thread will not affect the focus, only serve to delay any front panel updates as the UI thread receives competing requests. If you leave your DLLs in the UI thread, make sure they return from each call immediately. If you can find an example that demonstrates the focus change, please do share it.

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 9 of 9
(2,922 Views)