Sometimes it is desirable to open or close GSEOS screen files from a script. To open a screen window you use the FileOpen() method of the Gseos module. You specify the file name of the screen file you wish to open and the file gets loaded and the window displayed.
The window is displayed on the active desktop page. If you want to locate the screen on a different desktop page you have to activate that desktop page. You can do this with Gseos.SetActiveDesktopPage().
Once a screen is open you can change it's appearance with WindowMinimize(), WindowMaximize(), or WindowRestore(). You can also close it with WindowClose(). All these functions are located in the Gseos module. Note that the Window... functions take the window caption as their parameter to identify the screen you want to operate on. So if you have assigned a title to the window that is different from the file name you want to use that title to access the correct window.
Oftentimes you might want to activate or restore a window if it exists, and if it doesn't you want to load it. This will make sure you don't load the same window multiple times. The following example defines a command that will open the window if it exists and load it otherwise. fOpenScreen() assumes that the title of the window is that same as the file name. This is also the parameter you have to pass into the function. fOpenScreen() take advantage of the fact that GSEOS raises a RuntimeError when it can't locate the window you try to restore. It then tries to load the file with FileOpen().