Top  | Previous | Next

system.gui.getWindow

Description

Finds a reference to an open window with the given name. Throws a ValueError if the named window is not open or not found.

Syntax

system.gui.getWindow(name)

Parameters

String name - The path to the window to field.

Returns

PyObject - A reference to the window, if it was open.

Scope

Client

Examples

Example 1:

 

This example will get the window named 'Overview' and then close it.

 

try:
   window = system.gui.getWindow('Overview')
   system.gui.closeWindow(window)
 
except ValueError:
   system.gui.warningBox("The Overview window isn't open")

 

Example 2:

 

This example will set a value on a label component in the 'Header' window.

 

try:
   window = system.gui.getWindow('Header')
   window.getRootContainer().getComponent('Label').text = "Machine 1 Starting"
 
except ValueError:
   system.gui.warningBox("The Header window isn't open")