FROM : John Terranova
DATE : Mon Oct 04 20:27:30 2004
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_removed>
"You never know what you'll do
until you do what you do
when you're broke." -- Todd Snider, "Broke"
DATE : Mon Oct 04 20:27:30 2004
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_removed>
"You never know what you'll do
until you do what you do
when you're broke." -- Todd Snider, "Broke"
| Related mails | Author | Date |
|---|---|---|
| George Lawrence St… | Oct 4, 19:24 | |
| John Terranova | Oct 4, 20:27 |






Cocoa mail archive

