LESSON

Swapping vs. Opening

Description

There are two primary window navigation operations: swapping and opening. Learn when and how to use each navigation operation.

Video recorded using: Ignition 8.1

Transcript

(open in window)

[00:00] There are two primary window navigation operations - swapping and opening. Swapping between windows involves the closing of the current window and the opening of the window you wish to swap to. We can see this swapping window behavior here on the left. As I click on a different button on my west docked window the currently open main window on the right closes and my selected window denoted by each button, opens up to replace it. Every time I click on a different navigation button I am swapping the currently open main window on my vision client. Because of this, if I click on the windows menu up above, you will note that there are only two open windows at any given time - my main window and my navigation window. Opening a window simply opens a window and does not close or swap a window. A perfect example of this is pop-up windows. If I press this button, a pop-up window opens without any other window being closed.

[01:05] In fact, if I press this button a few more times you will note that for every click a new instance of my pop-up window will open. Typically you want to use the open operation for pop-up screens as well as docked windows. Because you can only see one of your main windows screens at a time, you want to use the swap operation for main screens like our main window here. If I have two main windows open I will not be able to use one of them because the other would simply be stacked on top. To show an example of this behavior, let's head back to our designer where I have my west docked navigation window open. I will double click on my button here to bring up its scripting editor. Instead of having this button swap windows I will configure it to open a window instead. I will do the same with the next button and configure it to open a window. And I will do the same with my last button.

[02:05] I will save my changes and head back to my vision client. Clicking each of my navigation buttons, it will appear that only one main window is open at a time. But going back to our windows menu above, you will note that there is in fact more than one main window open. The rest are just hiding in the background. Having multiple main windows open at once could mean that any bindings, scripts, or other functionality associated with these hidden windows could be unwantedly running in the background, increasing the resource overhead of your application. For this reason, when working with main windows it is recommended to use the swap window operation.

You are editing this transcript.

Make any corrections to improve this transcript. We'll review any changes before posting them.