Re: NSPrintInfo change notification?
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