How to get an NSWindow from an NSDocument?
How to get an NSWindow from an NSDocument?
- Subject: How to get an NSWindow from an NSDocument?
- From: "Theodore H. Smith" <email@hidden>
- Date: Mon, 23 May 2005 17:56:25 +0100
I have a document based Cocoa app.
I want to do stuff to it's window, like set the title of the window
when I open a file. However, I can't figure out how to get an NSWindow
from the NSDocument. I tried this:
- (NSWindow*) window { // from a subclass of NSDocument
NSArray* a = [self windowControllers];
NSWindowController* wc = [a objectAtIndex:0];
NSWindow* w = [wc window];
return w;
}
But I get an error that the NSArray actually contains no window
controllers. What was I doing wrong?
--
elfdata.com/plugin/ Industrial strength string processing, made easy.
"All things are logical. Putting free-will in the slot for premises in
a logical system, makes all of life both understandable, and free."
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden