• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to use NSPrintHeaderAndFooter
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: How to use NSPrintHeaderAndFooter
      • From: email@hidden
References: 
 >Re: How to use NSPrintHeaderAndFooter (From: Matt Neuburg <email@hidden>)

  • Prev by Date: Re: scrolling NSTextView over NSImageView
  • Next by Date: Re: How to use NSPrintHeaderAndFooter
  • Previous by thread: Re: How to use NSPrintHeaderAndFooter
  • Next by thread: Re: How to use NSPrintHeaderAndFooter
  • Index(es):
    • Date
    • Thread