How to update preview in NSPrintPanel?
How to update preview in NSPrintPanel?
- Subject: How to update preview in NSPrintPanel?
- From: Luc Van Bogaert <email@hidden>
- Date: Sun, 25 Dec 2011 23:05:31 +0100
Hi,
I'm adding a custom user setting to a NSPrintPanel by adding an "accessory view controller" for a view that contains just one control (a checkbox) and which is loaded from a nib file. The checkbox's value has a binding to the view controller's "representedObject.printSettings.checkboxvalue" keypath. (The representedObject is a NSPrintInfo object).
I have been able to verify that this binding works correctly.
One thing I haven't gotten to work yet, is to automatically update the "preview" in the print panel when I chance the state of the checkbox. The preview updates itself correctly when I change one of the "built-in" settings, and it even correctly represents my own custom setting. But, how can I trigger an automatic update when I just change my own custom setting?
I assume I should implement the "keyPathsForValuesAffectingPreview" protocol method in my accessory view controller, which I did, but so far without success. Here's my implementation:
- (NSSet *)keyPathsForValuesAffectingPreview
{
return [NSSet setWithObjects:
[NSString stringWithFormat:@"representedObject.printSettings.checkboxvalue"],
nil];
}
Any help much appreciated.
--
Luc Van Bogaert
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden