• 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: how to update the view of NSPrintOperation ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to update the view of NSPrintOperation ?


  • Subject: Re: how to update the view of NSPrintOperation ?
  • From: "debin lei" <email@hidden>
  • Date: Wed, 14 May 2008 21:13:18 +0800

Thank you for your infomation, i know the function
keyPathsForValuesAffectingPreview, however, i did not know how to use it.
 I have looked the Reference.
It said " an accessory view modifies printing-related properties that are
used by the print preview, you should implement this method to return the
key paths for those properties. For example, if you write an accessory view
that lets the user change the left and right document margins in the current
NSPrintInfo object, you would return the following key paths:
representedObject.leftMargin, representedObject.rightMargin. (The
NSPrintInfo object is the represented object of the accessory controller.) "
Can you give me more detail about it? I want the preview NSView call its
drawrect function when i press the button in the accessory view . How to do
this?




2008/5/14 douglas a. welton <email@hidden>:

>   On May 14, 2008, at 2:46 AM, debin lei wrote:
>
>
> 1.
> When i implement printing with cocoa, an NSPrintOperation object is
> created to control the print operation (see
> the NSPrintOperation class description for details).
>
>  NSPrintOperation * printOp =
> [NSPrintOperation printOperationWithView:viewToPrint printInfo:printInfo];
> viewToPrint is my NSView for printing.
> I augment printpanel display by adding a custom NSView using
> the addAccessoryController: method.
> I put one button into the view. When user presses the button,i want to
> do some logic and notices viewToPrint the update.Because the print
> datachanged.So the preview in the print dialog should be updated. How can i
> do this, let the viewToPrint update with  printOp or other methods?
>
>
> I presume that your accessoryController is implementing the
> NSPrintPanelAccessorizing protocol.  Check out the documentation for the -
> (NSSet)keyPathsForValuesAffectingPreview method in that protocol.  In
> essence, this method lets the preview know when it should update itself.
>
> regards,
>
> douglas
>
>
_______________________________________________

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

References: 
 >how to update the view of NSPrintOperation ? (From: "debin lei" <email@hidden>)
 >Re: how to update the view of NSPrintOperation ? (From: "douglas a. welton" <email@hidden>)

  • Prev by Date: Re: Capture screenshot
  • Next by Date: Assertion failure in -[NSNextStepFrame lockFocus]
  • Previous by thread: Re: how to update the view of NSPrintOperation ?
  • Next by thread: Re: how to update the view of NSPrintOperation ?
  • Index(es):
    • Date
    • Thread