O'Reilly logo

Cocoa in a Nutshell by James Duncan Davidson, Michael Beam

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

NSPrintPanel — Mac OS X 10.0

Synopsis

This class provides the Mac OS X Print panel interface for Cocoa applications. To obtain an instance of NSPrintPanel, use the class method printPanel. The panel is displayed and run when the runModal method is invoked, which will display the print panel as a window. It is also possible to display the print panel as a sheet attached to the document window; this is done with the method beginSheetWithPrintInfo:modalFor-Window: delegate:didEndSelector:contextInfo:.

Cocoa allows you to attach an accessory view to the print panel, providing an interface for users to configure options related to how your application handles printing. To set the accessory view, use the method setAccessoryView:.

image with no caption

@interface NSPrintPanel : NSObject
                                  // Accessor Methods
   - (void)setAccessoryView:(NSView *)aView;
   - (NSView *)accessoryView;
   - (void)setJobStyleHint:(NSString *)hint;
   - (NSString *)jobStyleHint;
                                  // Class Methods
   + (NSPrintPanel *)printPanel;
                                  // Instance Methods
   - (void)beginSheetWithPrintInfo:(NSPrintInfo *)printInfo 
                                 modalForWindow:(NSWindow *)docWindow
                                 delegate:(id)delegate 
                                 didEndSelector:(SEL)didEndSelector 
                                 contextInfo:(void *)contextInfo;
   - (void)finalWritePrintInfo;
   - (void)pickedAllPages:(id)sender;
   - (void)pickedButton:(id)sender;
   - (void)pickedLayoutList:(id)sender;
   - (int)runModal;
   - (void)updateFromPrintInfo;

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required