Next Page > Hide TOC

Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

NSPageLayout

Inherits from
Package
com.apple.cocoa.application
Companion guide

Overview

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 or modally using runModal or runModalWithPrintInfo.

Tasks

Constructors

Creating an NSPageLayout

Running an NSPageLayout

Customizing an NSPageLayout

Accessing the NSPrintInfo

Deprecated Methods

Constructors

NSPageLayout

Creates an empty NSPageLayout.

public NSPageLayout()

Static Methods

pageLayout

Returns a newly created NSPageLayout object.

public static NSPageLayout pageLayout()

Instance Methods

accessoryView

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

public NSView accessoryView()

See Also

beginSheetWithPrintInfo

Presents a page layout sheet for printInfo, document modal relative to docWindow.

public void beginSheetWithPrintInfo(NSPrintInfo printInfo, NSWindow docWindow, Object delegate, NSSelector didEndSelector, Object contextInfo)

Discussion

When the modal session ends, if neither delegate nor didEndSelector is null, didEndSelector is invoked on delegate, passing contextInfo, among others, as an argument.

The didEndSelector argument must have the same signature as:

public void pageLayoutDidEnd (NSPageLayout pageLayout, int returnCode,  void contextInfo)

The value passed as returnCode will be either PLCancelButton or PLOKButton.

pickedButton

public void pickedButton(Object sender)

Discussion

This method has been deprecated.

pickedOrientation

public void pickedOrientation(Object sender)

Discussion

This method has been deprecated.

pickedPaperSize

public void pickedPaperSize(Object sender)

Discussion

This method has been deprecated.

pickedUnits

public void pickedUnits(Object sender)

Discussion

This method has been deprecated.

printInfo

Returns the NSPrintInfo object used when the receiver is run.

public NSPrintInfo printInfo()

Discussion

The NSPrintInfo object is set using the beginSheetWithPrintInfo or runModalWithPrintInfo method. The shared NSPrintInfo object is used if the receiver is run using runModal.

See Also

readPrintInfo

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

public void readPrintInfo()

Discussion

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

See Also

runModal

Displays the receiver and begins the modal loop.

public int runModal()

Discussion

The receiver’s values are recorded in the shared NSPrintInfo object. Returns PLCancelButton if the user clicks the Cancel button; otherwise returns PLOKButton.

See Also

runModalWithPrintInfo

Displays the receiver and begins the modal loop.

public int runModalWithPrintInfo(NSPrintInfo printInfo)

Discussion

The receiver’s values are recorded in printInfo. Returns PLCancelButton if the user clicks the Cancel button; otherwise returns PLOKButton.

See Also

setAccessoryView

Adds an NSView to the receiver.

public void setAccessoryView(NSView aView)

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 null, then the receiver’s current accessory view, if any, is removed.

See Also

writePrintInfo

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

public void writePrintInfo()

Discussion

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

See Also


Next Page > Hide TOC


© 1997, 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-02-01)


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.