Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Hiding windows instead of closing them

Hiding windows instead of closing them
Thread Tools
Professional Poster
Join Date: Apr 2001
Location: Long Beach, CA
Status: Offline
Reply With Quote
Aug 16, 2002, 08:25 AM
 
I know there's a way to do this--I've seen it in the documentation. However, with all the stuff I've tried, the windows are still being closed.

Expected functionality:

user clicks the close window. Later, they do something else that will bring that exact same window back. I tell the NSWindowController to show the window. However, the NSWindowController doesn't exist anymore and has been removed from the NSDocument's list of NSWindowControllers. I've tried marking the windows to not be released when closed, but they are dissappearing anyway. (however, if the window is minimized, it is brought to the front.)

Any ideas?

ACSA 10.4/10.3, ACTC 10.3, ACHDS 10.3
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Aug 16, 2002, 03:10 PM
 
You could implement the -windowShouldClose: delegate method and just hide the window yourself with that. That seems like the simplest solution.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
Detrius  (op)
Professional Poster
Join Date: Apr 2001
Location: Long Beach, CA
Status: Offline
Reply With Quote
Aug 18, 2002, 02:57 PM
 
Originally posted by Chuckit:
You could implement the -windowShouldClose: delegate method and just hide the window yourself with that. That seems like the simplest solution.
That did work pretty well. One important detail though:

Code:
- (BOOL)windowShouldClose:(id)sender { [[self window] orderOut: sender]; return NO; // gotta say NO }

ACSA 10.4/10.3, ACTC 10.3, ACHDS 10.3
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 06:10 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2