• 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: Problem when running the print panel in a sheet: NSPrintOperationExistsException
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem when running the print panel in a sheet: NSPrintOperationExistsException


  • Subject: Re: Problem when running the print panel in a sheet: NSPrintOperationExistsException
  • From: Nick Zitzmann <email@hidden>
  • Date: Wed, 1 Oct 2003 00:07:38 -0700

On Tuesday, September 30, 2003, at 11:18 PM, Berk Ozer wrote:

I handle printing by showing the print panel first.
Then, within the method

(void) printOperationDidRun:success:contextInfo:

I call

(void) print:(id)sender

method of the view, which is to be printed. Standard stuff.

This is the wrong way to do it, since NSView will launch a print panel itself when -print: is called, and that is why an exception is being raised. What you might want to try instead, if you want to run a print panel as a sheet, is to use the NSPrintOperation class, like this, if your view is called "someView", window is "someWindow":

(disclaimer: written in Mail, untested, use at your own risk, and all that)

NSPrintOperation *operation = [NSPrintOperation printOperationWithView:someView];
[operation runOperationModalForWindow:someWindow delegate:nil didRunSelector:nil contextInfo:nil];

Nick Zitzmann
AIM/iChat: dragonsdontsleep
Check out my software page: http://seiryu.home.comcast.net/

"I have always wished that my computer would be as easy to use as my telephone. My wish has come true. I no longer know how to use my telephone." - Bjarne Stroustrup
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
  • Follow-Ups:
    • Re: Problem when running the print panel in a sheet: NSPrintOperationExistsException
      • From: Berk Ozer <email@hidden>
References: 
 >Problem when running the print panel in a sheet: NSPrintOperationExistsException (From: Berk Ozer <email@hidden>)

  • Prev by Date: Re: Address Book Helper code released to public domain
  • Next by Date: Re: Problem when running the print panel in a sheet: NSPrintOperationExistsException
  • Previous by thread: Problem when running the print panel in a sheet: NSPrintOperationExistsException
  • Next by thread: Re: Problem when running the print panel in a sheet: NSPrintOperationExistsException
  • Index(es):
    • Date
    • Thread