Mac Developer Library

Developer

AppKit Framework Reference NSPageLayout Class Reference

Options
Deployment Target:

On This Page
Language:

NSPageLayout

NSPageLayout is a panel that queries the user for information such as paper type and orientation. It is normally displayed in response to the user selecting the Page Setup menu item. You obtain an instance with the pageLayout class method. The pane can then be run as a sheet using beginSheetWithPrintInfo:modalForWindow:delegate:didEndSelector:contextInfo: or modally using runModal or runModalWithPrintInfo:.

Inheritance


Conforms To


Import Statement


Swift

import AppKit

Objective-C

@import AppKit;

Availability


Available in OS X v10.0 and later.
  • Returns a newly created NSPageLayout object.

    Declaration

    Objective-C

    + (NSPageLayout *)pageLayout

    Import Statement

    Objective-C

    @import AppKit;

    Availability

    Available in OS X v10.0 and later.

  • Presents a page setup sheet for the given NSPrintInfo object, document-modal relative to the given window.

    Declaration

    Swift

    func beginSheetWithPrintInfo(_ printInfo: NSPrintInfo, modalForWindow docWindow: NSWindow, delegate delegate: AnyObject?, didEndSelector didEndSelector: Selector, contextInfo contextInfo: UnsafeMutablePointer<Void>)

    Objective-C

    - (void)beginSheetWithPrintInfo:(NSPrintInfo *)printInfo modalForWindow:(NSWindow *)docWindow delegate:(id)delegate didEndSelector:(SEL)didEndSelector contextInfo:(void *)contextInfo

    Parameters

    printInfo

    The NSPrintInfo object to use.

    docWindow

    The window to which the sheet is attached.

    delegate

    The delegate to which didEndSelector is sent. Can be nil.

    didEndSelector

    The selector sent to the delegate. Can be nil.

    contextInfo

    Context information object passed with didEndSelector.

    Discussion

    The didEndSelector argument must have the same signature as:

    • - (void)pageLayoutDidEnd:(NSPageLayout *)pageLayout returnCode:(int)returnCode contextInfo: (void *)contextInfo;

    The value passed as returnCode is either NSCancelButton or NSOKButton.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Displays the receiver and begins the modal loop using the shared NSPrintInfo object.

    Declaration

    Swift

    func runModal() -> Int

    Objective-C

    - (NSInteger)runModal

    Return Value

    NSCancelButton if the user clicks the Cancel button; otherwise, NSOKButton.

    Discussion

    The receiver’s values are recorded in the shared NSPrintInfo object.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Displays the receiver and begins the modal loop using the given NSPrintInfo object.

    Declaration

    Swift

    func runModalWithPrintInfo(_ printInfo: NSPrintInfo) -> Int

    Objective-C

    - (NSInteger)runModalWithPrintInfo:(NSPrintInfo *)printInfo

    Parameters

    printInfo

    The NSPrintInfo object to use.

    Return Value

    NSCancelButton if the user clicks the Cancel button; otherwise, NSOKButton.

    Discussion

    The receiver’s values are recorded in printInfo.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

    See Also

    – runModal

  • Returns the receiver’s accessory view (used to customize the receiver).

    Deprecation Statement

    Deprecated in OS X v10.5. Use accessoryControllers instead.

    Declaration

    Objective-C

    - (NSView *)accessoryView

    Import Statement

    Objective-C

    @import AppKit;

    Availability

    Available in OS X v10.0 and later.

    Deprecated in OS X v10.5.

  • Adds a view object to the receiver.

    Deprecation Statement

    Deprecated in OS X v10.5. Use addAccessoryController: instead.

    Declaration

    Objective-C

    - (void)setAccessoryView:(NSView *)accessoryView

    Discussion

    Invoke this method to add a custom view containing your controls. aView is added to the receiver’s Settings popup menu with your application’s name as its menu item. The receiver is automatically resized to accommodate aView. This method can be invoked repeatedly to change the accessory view depending on the situation. If aView is nil, then the receiver’s current accessory view, if any, is removed.

    Import Statement

    Objective-C

    @import AppKit;

    Availability

    Available in OS X v10.0 and later.

    Deprecated in OS X v10.5.

  • Sets the receiver’s values to those stored in the NSPrintInfo object used when the receiver is run.

    Deprecation Statement

    Deprecated in OS X v10.5. This method should not be invoked directly, so there is no replacement.

    Declaration

    Objective-C

    - (void)readPrintInfo

    Discussion

    Do not invoke this method directly; it is invoked automatically before the receiver is displayed.

    Import Statement

    Objective-C

    @import AppKit;

    Availability

    Available in OS X v10.0 and later.

    Deprecated in OS X v10.5.

  • Writes the receiver’s values to the NSPrintInfo object used when the receiver is run.

    Deprecation Statement

    Deprecated in OS X v10.5. This method should not be invoked directly, so there is no replacement.

    Declaration

    Objective-C

    - (void)writePrintInfo

    Discussion

    Do not invoke this method directly; it is invoked automatically when the receiver is dismissed.

    Import Statement

    Objective-C

    @import AppKit;

    Availability

    Available in OS X v10.0 and later.

    Deprecated in OS X v10.5.