Re: Stupid question: how do you show an NSWindow?
Re: Stupid question: how do you show an NSWindow?
- Subject: Re: Stupid question: how do you show an NSWindow?
- From: "I. Savant" <email@hidden>
- Date: Mon, 10 Mar 2008 14:25:57 -0400
> This is going to sound really stupid, but how do you show an
> NSWindow? [aWindow close] seems to be the appropriate method to close
> it, but idiotically enough, I can't seem to find a way re-show the
> window once it's no longer on-screen. [aWindow
> makeKeyAndOrderFront:sender] will only bring the window forward if
> it's already visible, and doesn't seem to do anything if the window
> isn't already there.
Your perception of -makeKeyAndOrderFront: (the correct method, by
the way), depends entirely on what you mean by "not already there".
Give this a thorough read so you understand windows the Cocoa Way:
http://developer.apple.com/documentation/Cocoa/Conceptual/WinPanel/WinPanel.html
Also, note that the docs for -close: say:
"If the receiver is set to be released when closed, a release message
is sent to the object after the current event is completed. For an
NSWindow object, the default is to be released on closing ..."
So if you've closed it and it's released, subsequent calls to
-makeKeyAndOrderFront: don't really make sense. You'll want to tell
your windows to -orderOut: if you want to use them again.
--
I.S.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden