• 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: NSPrintInfo change notification?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSPrintInfo change notification?


  • Subject: Re: NSPrintInfo change notification?
  • From: John Terranova <email@hidden>
  • Date: Mon, 4 Oct 2004 11:27:30 -0700


On Oct 4, 2004, at 10:24 AM, George Lawrence Storm wrote:

Is there a NSPrintInfo change notification I can register for so I can know when the user has changed the Page Setup?
(I need to refresh my view size and printable area marks.)

Not that I know of.

Otherwise is there particular method I should override in my document (or window) so I can create my own notification?

In NSDocument:

- (void)setPrintInfo:(NSPrintInfo *)printInfo

This is from my subclass of NSDocument:

- (void)setPrintInfo:(NSPrintInfo *)printInfo
{
[super setPrintInfo:printInfo];

// now call [self imageablePageBounds]
// or post a notification, or whatever.

// I essentially do this and let bindings take care of the rest:
YABIDataManager *dataMan = [self dataManager];
[dataMan setPaperSize:[self paperSize]];
[dataMan setImageablePageBounds:[self imageablePageBounds]];
}

Possibly a better way to do this would be something like:

- (void)setPrintInfo:(NSPrintInfo *)printInfo
{
[self willChangeValueForKey:@"printInfo"];
[super setPrintInfo:printInfo];
[self didChangeValueForKey:@"printInfo"];

// let bindings propagate any changes
}
--
john terranova, email@hidden

"You never know what you'll do
until you do what you do
when you're broke." -- Todd Snider, "Broke" _______________________________________________
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
References: 
 >NSPrintInfo change notification? (From: George Lawrence Storm <email@hidden>)

  • Prev by Date: Re: Changing the background of a 1 bit bitmap?
  • Next by Date: Re: tinting an NSImage
  • Previous by thread: NSPrintInfo change notification?
  • Next by thread: MEETING: Chicago - Tuesday October 5th 6:00 PM
  • Index(es):
    • Date
    • Thread