Class

NSPrintPanel

The Print panel that queries the user for information about a print job.

Declaration

class NSPrintPanel : NSObject

Overview

A Print panel may let the user select the range of pages to print and the number of copies before executing the Print command. Print panels can display a simplified interface when printing certain types of data. For example, the panel can display a list of print-setting presets, which lets the user enable print settings in groups as opposed to individually. Assigning an appropriate string to the jobStyleHint property activates the simplified interface and identifies which presets to display.

Topics

Customizing the Panel

var jobStyleHint: NSPrintPanel.JobStyleHint?

The type of settings that the print panel displays.

struct NSPrintPanel.JobStyleHint

Constants to be used as job style hints for activating the simplified Print panel interface and setting the options to display.

var options: NSPrintPanel.Options

The current configuration options for the Print panel.

struct NSPrintPanel.Options

These constants are used to configure the contents of the main Print panel.

func defaultButtonTitle() -> String?

Returns the title of the Print panel’s default button.

func setDefaultButtonTitle(String?)

Sets the title of the Print panel’s default button.

var helpAnchor: NSHelpManager.AnchorName?

The HTML help anchor associated with the Print panel.

Managing Accessory Views

func addAccessoryController(NSViewController & NSPrintPanelAccessorizing)

Adds a custom controller to the Print panel to manage an accessory view.

func removeAccessoryController(NSViewController & NSPrintPanelAccessorizing)

Removes the specified controller and accessory view from the Print panel.

protocol NSPrintPanelAccessorizing

A set of methods that a print panel object can use to get information from a printing accessory controller.

var accessoryControllers: [NSViewController]

The array of controller objects that manage the Print panel’s accessory views.

Running the Panel

func runModal() -> Int

Displays the receiver's Print panel and begins the modal loop.

func runModal(with: NSPrintInfo) -> Int

Displays the receiver’s Print panel and runs the modal loop using the specified printing information.

Communicating with the NSPrintInfo Object

var printInfo: NSPrintInfo

The printing information associated with the running Print panel.

Relationships

Inherits From

Conforms To

See Also

Print Panels

class NSPageLayout

A panel that queries the user for information such as paper type and orientation.