Locate All Opened Windows In Client

Open Windows and Performance

While a window is open, its query bindings are running, its Tag bindings are keeping Tags subscribed, and its event scripts are being executed. This means that an open window is actively using system resources, both on the Client's host machine, and on the Gateway's server machine as its queries and Tag subscriptions must be handled. For these reasons, it is important that you properly implement a navigation strategy that prevents windows that are no longer being used from being held open. Fortunately, Ignition can tell you all the windows you currently have open in a client.

You can locate all of the currently opened windows in a Client from the Windows menu command. It is important to note, this list shows you the Title of each of the windows, not the name or path of the window.

images/download/attachments/6047770/Open_Windows_in_Menu_Bar.png

Window Titles

By default, Ignition assigns the Title property the same name as the window type you're creating (i.e., Main Window, Docked Window, and Popup Window). If you notice that you have two windows with the same name in the Window Menu dropdown list, go to Property Editor and change the Title from the window type to whatever you want to call your window (i.e., Main Window 1, Main Window 2, etc,), making sure the Titles are unique.

When you use one of the Project Templates, by default, all of the existing Main Window Titles are bound to the text in the header label. This is a very easy way to keep track of which windows are open.

If your project has multiple windows with the same Title (i,e: both docked windows are called 'Navigation'), you can correct the duplicate Title in the Designer. Open one of the windows and go to the Property Editor, and change the Title property. Once again make sure the Title names are unique.

Duplicate Navigation Windows

images/download/attachments/6047770/Window_Menu_Duplicate_Large2.png

Rename North 'Navigation Window to 'Header'

images/download/attachments/6047770/Property_Editor_for_Title_Header.png

Find Open Windows with Scripting

You can use the system.gui.getOpenedWindows() or system.gui.getOpenedWindowNames() functions in a script to get a list of the currently open windows in a client. Once you have the list, you can step through it and do whatever you want. IE: check properties for a match, use the list to decide whether to open another window, etc. Refer to the function descriptions in the Appendix for examples of how they are used.

Similar Topics ...