[NSWindow orderOut] from NSOpenGLView?
I have a subclassed NSOpenGLView residing in a window - the standard way, all set up in IB. Now, I'd like this window to go away from time to time, so I call [[self window] orderOut:self], and nothing happens. [[self window]center] works just fine, and NSLogging [self window] looks all right. Is there something obvious I'm overlooking, or have I just messed up somewhere else?
I may be wrong, but have you made the window to be the delegate of File's Owner in IB? It may not be required though, but it never hurts to try
"When you dream, there are no rules..."
Wiring it as a delegate of anything won't help since it isn't a delegate method. [[self window] orderOut:self] *should* work as is if [[self window]center] is right next to it and works. Maybe Xcode is goofing up? Clean project? Turn off zero-link for a build? I have no clue, that's just bizarre that it won't work right.
OK, thanks for the help anyway. I'll try cutting back all of my functionality until I find the culprit.
In what class are you calling the [ self window ]? A NSWindowController? Or the view? I'm confused.
From a subclass of an NSOpenGLView... do I have to do it from a window controller?
No. It should work perfectly from anywhere - as long as you can get access to "window" of course.
One idea that just came to mind is that maybe orderOut is implemented somewhere else besides NSWindow, as it should be. You could try typing orderOut somewhere in your NSOpenGLView subclass, then cmd-double-click on it and it should come up highlighted in NSWindow.h. If it doesn't come up highlighted in NSWindow.h or if a pop-up comes up instead to allow you to choose more than one orderOut, then you found a problem.
One idea that just came to mind is that maybe orderOut is implemented somewhere else besides NSWindow, as it should be. You could try typing orderOut somewhere in your NSOpenGLView subclass, then cmd-double-click on it and it should come up highlighted in NSWindow.h. If it doesn't come up highlighted in NSWindow.h or if a pop-up comes up instead to allow you to choose more than one orderOut, then you found a problem.
Are you attempting to call orderOut in your awakeFromNib method? That won't work since the window isn't showing yet at that point, and the call is ignored.
Quote:That won't work since the window isn't showing yet at that point, and the call is ignored.Ah, that seems to be it. Let me rephrase that question then: how can I make a window not show up when the program starts? Just send it off to a really large coordinate on the X axis?
uncheck the "visible at launch" box in IB?
I do that crap all the time. Better you than me for a change!
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Nothing showing up in NSOpenGLView [newb] | binaryinsomnia | 6 | 4,902 |
Nov 29, 2011 07:04 PM Last Post: binaryinsomnia |
|
| Cocoa controls on top of NSOpenGLView | wadesworld | 5 | 5,071 |
Apr 6, 2009 01:38 AM Last Post: arekkusu |
|
| Antialiasing and NSOpenGLView attributes | Jar445 | 2 | 5,615 |
Jan 20, 2009 10:42 AM Last Post: maximile |
|
| Double-Buffering with NSOpenGLView | DesertPenguin | 3 | 4,800 |
Aug 1, 2006 07:17 AM Last Post: DesertPenguin |
|
| Showing resize control over NSOpenGLView | AnotherJake | 14 | 6,556 |
Oct 25, 2004 06:13 PM Last Post: AnotherJake |
|

