• 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
How to update preview in NSPrintPanel?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: How to update preview in NSPrintPanel?
      • From: Quincey Morris <email@hidden>
    • Re: How to update preview in NSPrintPanel?
      • From: Graham Cox <email@hidden>
  • Prev by Date: Re: Storyboard SplitViewController example
  • Next by Date: Re: How to update preview in NSPrintPanel?
  • Previous by thread: Re: Storyboard SplitViewController example
  • Next by thread: Re: How to update preview in NSPrintPanel?
  • Index(es):
    • Date
    • Thread