• 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: Berk Ozer <email@hidden>
  • Date: Wed, 1 Oct 2003 10:44:51 +0200

Okay, this solved the problem. Many thanks!
I didn't know an NSView would show its own
print panel when sent the print: message.

- Berk


On Wednesday, October 1, 2003, at 09:07 AM, Nick Zitzmann wrote:


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.

References: 
 >Re: Problem when running the print panel in a sheet: NSPrintOperationExistsException (From: Nick Zitzmann <email@hidden>)

  • Prev by Date: Re: Problem when running the print panel in a sheet: NSPrintOperationExistsException
  • Next by Date: Re: how to stop NSString/NSData from interpreting backslash
  • Previous by thread: Re: Problem when running the print panel in a sheet: NSPrintOperationExistsException
  • Next by thread: Re: how to stop NSString/NSData from interpreting backslash
  • Index(es):
    • Date
    • Thread