Re: Newbie - Setting a window to a title other then document file name
Re: Newbie - Setting a window to a title other then document file name
- Subject: Re: Newbie - Setting a window to a title other then document file name
- From: Bruno Gaufier <email@hidden>
- Date: Thu, 18 Sep 2003 20:42:49 +0200
Hello,
On Wednesday, September 17, 2003, at 11:25 PM, Tom Gray wrote:
I have a NSWindowController subclass whose window I would like to set
to a title other then the filename used by the NSDocument subclass. I
have tried:
[self windowTitleForDocumentDisplayName:@"Crewdog Terminal"];
try overriding the cocoa method in you NSWindowController subclass.
- (NSString *)windowTitleForDocumentDisplayName:(NSString *)displayName
{
if (![[self document] fileName])
// The document is somewhere on disk
return @"Whatever you want when doc on disk";
else
// The document has not been saved
return @"Whatever you want when doc not on disk";
}
Warning : i didn't check the above code's syntax because syntax
checking does not work in mail...
--
Bruno Gaufier
----
email@hidden
email@hidden
http://perso.club-internet.fr/bgaufier/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.