• 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
Using Carbon printing in Cocoa app; page setup and print sheets detached!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using Carbon printing in Cocoa app; page setup and print sheets detached!


  • Subject: Using Carbon printing in Cocoa app; page setup and print sheets detached!
  • From: Glen Low <email@hidden>
  • Date: Tue, 10 Apr 2007 01:23:47 +0800

Hi All

I'm using the Carbon printing manager to print something within my Cocoa app.

So for example I'm doing this override in my document class, so that the Page Setup command does a page setup sheet:

- (IBAction) runPageLayout: (id) sender
{
OSStatus err;
PMPrintSession printSession;
err = PMCreateSession (&printSession);
err = PMSessionUseSheets (printSession, [[self windowForSheet] windowRef], &PageSetupDialogDone);
err = PMSessionValidatePageFormat (printSession, pageFormat_, kPMDontWantBoolean);

Boolean accepted;
err = PMSessionPageSetupDialog (printSession, pageFormat_, &accepted);
}


And the callback:

static void PageSetupDialogDone (PMPrintSession printSession, WindowRef documentWindow, Boolean accepted)
{
OSStatus err;
err = PMRelease (printSession);
}


That works fine and dandy, but whenever I try to move the document window, the sheet "detaches" itself from the window!

(Cocoa must be doing some voodoo underneath the covers if it's implementing Cocoa printing using the Carbon printing manager...)

Any idea what's going on?

Otherwise (the big picture question), is there any way I can get a NSPrintOperation to work with something other than a NSView? The main reason I'm going to the CPM is that I need to drive the printing from my code, not allow Cocoa to call my view code during printing. Is it possible or nice to do multiple runs on different NSView's, where each NSView represents a single page, in a single print?




Cheers, Glen Low


--- pixelglow software | simply brilliant stuff www.pixelglow.com aim: pixglen

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


  • Prev by Date: Re: dumb bindings/user defaults question
  • Next by Date: Re: pointer address changes for no reason
  • Previous by thread: Crash with NSToolbarItem containing custom view
  • Next by thread: primary/secondary selection pattern for NSArrayController?
  • Index(es):
    • Date
    • Thread