• 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
[NewB] printing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[NewB] printing


  • Subject: [NewB] printing
  • From: email@hidden
  • Date: Thu, 2 Nov 2006 14:36:56 EST

OK...   before I anyone asks..

YES - I read the documentation
YES - I looked through cocoabuilder.com
YES - I looked at the textedit example.

I'm just looking for the minimal amount of code to implement printing a text
document. All of these examples are helpful but none seem to say how to go
about obtaining the view to print. I have an IBOutlet that points to my textview
and I used this for the view in the call to printOperationWithView:

It seems to work but I'm not sure if I should be adding other things (as in
the examples at cocoabuilder.com) The Apple TextEdit example is WAY to
complicated for me to pick apart at this early stage of my limited cocoa knowledge.

My question is.. Did I do this right? Do I need more? Here is my code..

-(void)printShowingPrintPanel:(BOOL)flag
{
     NSPrintInfo *printInfo = [self printInfo];
     NSPrintOperation *printOp;

     // textView is the IBOutlet
     printOp = [NSPrintOperation printOperationWithView:textView
                                                        printInfo:printInfo];
     [printOp setShowPanels:flag];

     [self runModalPrintOperation:printOp
                              delegate:nil
                       didRunSelector:NULL
                          contextInfo:NULL];
}
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: swizzling a class to a subclass inorder to add ivars (& methods) to a class
  • Next by Date: Re: swizzling a class to a subclass inorder to add ivars (& methods) to a class
  • Previous by thread: Re: Binding NSPopUpButton to an NSArrayController
  • Next by thread: Re: [NewB] printing
  • Index(es):
    • Date
    • Thread