Posted 20 years ago
by Boyd
-
Sr. Software Developer,
Patterson Consulting, LLC

When you create a TabbedMdiWindow (i.e. ToolWindow or DocumentWindow), you assign a Key in the constructor. I haven't seen any exceptions being thrown if I use the same key twice, but I wanted to know if there are any "gotchas" if I don't use unique keys.
For instance, I have multiple DocumentWindows that are created for editing files. I could make the Key of each window be the Filename, but then you run into problems when the name of the file changes (i.e saved as another filename). So far, I've just been giving them all the Key of "EDITOR", and everything appears to be working okay.
So I guess I have two questions...
1) Any problems with non-unique keys?
2) Is it safe (or even possible) to change a key to something else after it's been assigned in the Constructor?
Thanks again!
For instance, I have multiple DocumentWindows that are created for editing files. I could make the Key of each window be the Filename, but then you run into problems when the name of the file changes (i.e saved as another filename). So far, I've just been giving them all the Key of "EDITOR", and everything appears to be working okay.
So I guess I have two questions...
1) Any problems with non-unique keys?
2) Is it safe (or even possible) to change a key to something else after it's been assigned in the Constructor?
Thanks again!