At 4:29 PM -0700 4/20/06, Keith DeLong wrote:
Example 1: myWindow is set as the default window on launch. The user may or may not have closed this window. I now want to close myWindow if it is open.
It's not clear what you mean by that -- do you want to (a) close the specific myWindow that was opened automatically as the default window, or (b) open any myWindow that happens to be open, even if the user explicitly opened it? To do (a), you'd make it NOT the default window, but instead add a line to App.NewDocument to open a new myWindow, and store a reference to that in some app or global property. Then, you can use that reference to close the window.
Example 2: I tend to use myWindow.open employing auto instantiation quite often for windows like preferences. I got into this early on habit as it prevents multiple copies of the window from being open should the user bury lose the window and select Preferences menuitem a second time.
True, I use it for that too.
Occasionally I want to close one of these types of windows are non modal and I don't have a reference to it.
I can imagine that; I may even have run into this myself -- but I think I just zipped through the window list, and closed anything that IsA PreferencesWindow (or whatever I called my window class). I've never needed to do this for so many different windows that it was worth trying to generalize it. But, I now see why you asked the question -- if there were some easy way to generalize it, that might be handy if you have a lot of these one-instance window classes.
Best, - Joe -- Joseph J. Strout [EMAIL PROTECTED] _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives of this list here: <http://support.realsoftware.com/listarchives/lists.html>
