Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: edits/style, syntax
Scripting_function


Panel
titleDescription

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

Client permissions restrictions


Panel
titleSyntax

system.gui.getWindow(name)

  • Parameters

String name - The path to the window to field.

  • Returns

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

  • Scope

Vision Client

Panel
titleCode Examples
Code Block
languagepy
titleCode Snippet
# This example gets the window named 'Overview' and then closes it.
 
try:
   window = system.gui.getWindow('Overview')
   system.gui.closeWindow(window)
 
except ValueError:
   system.gui.warningBox("The Overview window isn't open")

Panel
Code Block
languagepy
titleCode Snippet
# This example sets 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")
Panel
titleKeywords

system gui getWindow, gui.getWindow