Re: How to use NSPrintHeaderAndFooter
Re: How to use NSPrintHeaderAndFooter
- Subject: Re: How to use NSPrintHeaderAndFooter
- From: Scott Anguish <email@hidden>
- Date: Wed, 12 Jul 2006 01:32:27 -0400
On Jul 11, 2006, at 11:45 PM, Matt Neuburg wrote:
On Tue, 11 Jul 2006 08:35:48 +0200 (CEST), email@hidden-
lyon1.fr said:
Hello all,
I have a Cocoa text editor that uses (a subclass of) NSTextView. I
want
the headers and footers printed, so I overrode the designated
initializer of
NSTextView as follows :
- (id)initWithFrame:(NSRect)frameRect textContainer:(NSTextContainer
*)aTextContainer
{
if ([super initWithFrame:frameRect textContainer:aTextContainer]) {
NSUserDefaults *defaults=[NSUserDefaults standardUserDefaults];
[defaults setBool:YES forKey: NSPrintHeaderAndFooter ];
}
return self;
}
But this doesn't work ... What am I doing wrong ?
The NSTextView is being created in the nib, so initWithFrame:... is
never
called. m.
Matt is probably right (assuming that is how you create the text
view instance of course).
the View Programming Guide for Cocoa discusses this issue
specifically and gives you suggestions as to where to do this kind of
setup
http://developer.apple.com/documentation/Cocoa/Conceptual/
CocoaViewsGuide/SubclassingNSView/chapter_5_section_2.html#//
apple_ref/doc/uid/TP40002978-CH7-DontLinkElementID_12
_______________________________________________
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