I am wanting to change a property in one window when a button is pressed in a separate window. I am wanting to do this with the Buttons Script editor. I am not sure how to be able to write to a property this way. What should I do for this kind of script? I don’t want to create more tags as i know i could do it that way. I would like to make it clean and simple.
Kind of what I want to do: event.source.parent.getComponent(‘Cube Status’).texturePath = “Changed”
Here’s code that does it. Modify this to get the window you want to get and put this in the actionPerformed script in the button.
try:
win = system.gui.getWindow("Main Windows/Main Window 3")
win.rootContainer.test = 5
except ValueError:
print "window is not open"
The excpetion handling is there in case the window isn’t open - in which case you can’t get it. You could use the system.nav.openWindow to open the window if it isn’t open.