Changing window's name without firing an "event"

Hi,

I have been looking into changing the name of some windows based on some tag names. I can’t seem to be able to access and change the window name in a binding to the tags and I have to write an script which involves firing an event which is not desirable. I do not want to allow any change to the windows name while the program is running of course.

Meanwhile I am currently using an expression binding on my window’s title property:

runscript("self.setName('desired name')", 0)

However, this only changes the name of the window at the bottom window bar of the designer where windows open when clicked on in the project tree. Their name does not however change in the tree under the Windows tree, where the project browser is. And when the save button is pressed the name change due to the expression binding reverts back to the original window name.

I was wondering if there is a way to achieve what I am trying to do?

Cheers

Window names are used under the hood in the project’s resources. Don’t change them. Change the window title, not the name.

1 Like

Try digging around in the JavaDocs starting with the ProjectResource class. Possibly it’s setName() method.

1 Like

Thanks for that.
The reason I am trying to bind the windows names to tags is so that if for whatever reason new windows are added or older ones are renamed, one has to only change the names of the tags and those tags could be used in scripts. This way one does not need to change the scripts every time windows change names etc, considering that pretty much all the system functions for navigation rely on windows’ names…

Consider reversing your logic – it is safe to read a window object’s name at any time, including client runtime, for use elsewhere in your scripts.

1 Like

Aaaaaaahhhhh…That makes much more sense. I see what you mean. Thanks for that.