Class

NSWindow

A window that an app displays on the screen.

Overview

A single NSWindow object corresponds to at most one onscreen window. The two principal functions of a window are to provide an area in which views can be placed and to accept and distribute, to the appropriate views, events the user instigates through actions with the mouse and keyboard.

Topics

Creating Windows

windowWithContentViewController:

Creates a titled window that contains the specified content view controller.

initWithContentRect:styleMask:backing:defer:

Initializes the window with the specified values.

initWithContentRect:styleMask:backing:defer:screen:

Initializes an allocated window with the specified values.

Configuring Windows

toggleFullScreen:

Takes the window into or out of fullscreen mode,

worksWhenModal

A Boolean value that indicates whether the window is able to receive keyboard and mouse events even when some other window is being run modally.

alphaValue

The window’s alpha value.

backgroundColor

The color of the window’s background.

colorSpace

The window’s color space.

contentView

The window’s content view, the highest accessible NSView object in the window’s view hierarchy.

contentViewController

The main content view controller for the window.

canHide

A Boolean value that indicates whether the window can be hidden when its application becomes hidden (during execution of the NSApplicationhide: method).

onActiveSpace

A Boolean value that indicates whether the window is on the currently active space.

hidesOnDeactivate

A Boolean value that indicates whether the window is removed from the screen when its application becomes inactive.

collectionBehavior

A value that identifies the window’s behavior in window collections.

opaque

A Boolean value that indicates whether the window is opaque.

hasShadow

A Boolean value that indicates whether the window has a shadow.

invalidateShadow

Invalidates the window shadow so that it is recomputed based on the current window shape.

autorecalculatesContentBorderThicknessForEdge:

Indicates whether the window calculates the thickness of a given border automatically.

setAutorecalculatesContentBorderThickness:forEdge:

Specifies whether the window calculates the thickness of a given border automatically.

contentBorderThicknessForEdge:

Indicates the thickness of a given border of the window.

setContentBorderThickness:forEdge:

Specifies the thickness of a given border of the window.

delegate

The window’s delegate.

preventsApplicationTerminationWhenModal

A Boolean value that indicates whether the window prevents application termination when modal.

Accessing Window Information

defaultDepthLimit

Returns the default depth limit for instances of NSWindow.

windowNumber

The window number of the window’s window device.

windowNumbersWithOptions:

Returns the window numbers for all visible windows satisfying the specified options.

gState

Returns the window’s graphics state object.

Deprecated
canStoreColor

Indicates whether the window has a depth limit that allows it to store color values.

Deprecated
deviceDescription

A dictionary containing information about the window’s resolution, such as color, depth, and so on.

canBecomeVisibleWithoutLogin

A Boolean value that indicates whether the window can be displayed at the login window.

sharingType

A Boolean value that indicates the level of access other processes have to the window’s content.

backingType

The window’s backing store type.

backingLocation

The location of the window’s backing store.

preferredBackingLocation

A Boolean value that indicates the preferred location for the window’s backing store.

oneShot

A Boolean value that indicates whether the window device the window manages is freed when it’s removed from the screen list.

depthLimit

The depth limit of the window.

hasDynamicDepthLimit

A Boolean value that indicates whether the window’s depth limit can change to match the depth of the screen it’s on.

Getting Layout Information

contentRectForFrameRect:styleMask:

Returns the content rectangle used by a window with a given frame rectangle and window style.

frameRectForContentRect:styleMask:

Returns the frame rectangle used by a window with a given content rectangle and window style.

minFrameWidthWithTitle:styleMask:

Returns the minimum width a window’s frame rectangle must have for it to display a title, with a given window style.

contentRectForFrameRect:

Returns the window’s content rectangle with a given frame rectangle.

frameRectForContentRect:

Returns the window’s frame rectangle with a given content rectangle.

Managing Windows

drawers

The collection of drawers associated with the window.

Deprecated
windowController

The window’s window controller.

Managing Sheets

attachedSheet

The sheet attached to the window.

sheet

A Boolean value that indicates whether the window has ever run as a modal sheet.

beginSheet:completionHandler:

Starts a document-modal session and presents—or queues for presentation—a sheet.

beginCriticalSheet:completionHandler:

Starts a document-modal session and presents the specified critical sheet.

endSheet:

Ends a document-modal session and dismisses the specified sheet.

endSheet:returnCode:

Ends a document-modal session and dismisses the specified sheet.

sheetParent

The window to which the sheet is attached.

sheets

An array of the sheets currently attached to the window.

Sizing Windows

frame

The window’s frame rectangle in screen coordinates, including the title bar.

setFrameOrigin:

Positions the bottom-left corner of the window’s frame rectangle at a given point in screen coordinates.

setFrameTopLeftPoint:

Positions the top-left corner of the window’s frame rectangle at a given point in screen coordinates.

constrainFrameRect:toScreen:

Modifies and returns a frame rectangle so that its top edge lies on a specific screen.

cascadeTopLeftFromPoint:

Positions the window's top left to a given point.

setFrame:display:

Sets the origin and size of the window’s frame rectangle according to a given frame rectangle, thereby setting its position and size onscreen.

setFrame:display:animate:

Sets the origin and size of the window’s frame rectangle, with optional animation, according to a given frame rectangle, thereby setting its position and size onscreen.

animationResizeTime:

Specifies the duration of a smooth frame-size change.

aspectRatio

The window’s aspect ratio, which constrains the size of its frame rectangle to integral multiples of this ratio when the user resizes it.

minSize

The minimum size to which the window’s frame (including its title bar) can be sized.

maxSize

The maximum size to which the window’s frame (including its title bar) can be sized.

zoomed

A Boolean value that indicates whether the window is in a zoomed state.

performZoom:

This action method simulates the user clicking the zoom box by momentarily highlighting the button and then zooming the window.

zoom:

This action method toggles the size and location of the window between its standard state (provided by the application as the “best” size to display the window’s data) and its user state (a new size and location the user may have set by moving or resizing the window).

resizeFlags

The flags field of the event record for the mouse-down event that initiated the resizing session.

showsResizeIndicator

A Boolean value that indicates whether the window’s resize indicator is visible.

resizeIncrements

The window’s resizing increments.

preservesContentDuringLiveResize

A Boolean value that indicates whether the window tries to optimize user-initiated resize operations by preserving the content of views that have not changed.

inLiveResize

A Boolean value that indicates whether the window is being resized by the user.

Sizing Content

contentAspectRatio

The window’s content aspect ratio.

contentMinSize

The minimum size of the window’s content view in the window’s base coordinate system.

setContentSize:

Sets the size of the window’s content view to a given size, which is expressed in the window’s base coordinate system.

contentMaxSize

The maximum size of the window’s content view in the window’s base coordinate system.

contentResizeIncrements

The window’s content-view resizing increments.

contentLayoutGuide

A value used by Auto Layout constraints to automatically bind to the value of contentLayoutRect.

contentLayoutRect

The area inside the window that is for non-obscured content, in window coordinates.

maxFullScreenContentSize

A maximum size that is used to determine if a window can fit when it is in full screen in a tile.

minFullScreenContentSize

A minimum size that is used to determine if a window can fit when it is in full screen in a tile.

Managing Window Layers

orderOut:

Removes the window from the screen list, which hides the window.

orderBack:

Moves the window to the back of its level in the screen list, without changing either the key window or the main window.

orderFront:

Moves the window to the front of its level in the screen list, without changing either the key window or the main window.

orderFrontRegardless

Moves the window to the front of its level, even if its application isn’t active, without changing either the key window or the main window.

orderWindow:relativeTo:

Repositions the window’s window device in the window server’s screen list.

level

The window level of the window.

Managing Window Visibility and Occlusion State

visible

A Boolean value that indicates whether the window is visible onscreen (even when it’s obscured by other windows).

occlusionState

The occlusion state of the window.

Managing Window Frames in User Defaults

removeFrameUsingName:

Removes the frame data stored under a given name from the application’s user defaults.

setFrameUsingName:

Sets the window’s frame rectangle by reading the rectangle data stored under a given name from the defaults system.

setFrameUsingName:force:

Sets the window’s frame rectangle by reading the rectangle data stored under a given name from the defaults system. Can operate on non-resizable windows.

saveFrameUsingName:

Saves the window’s frame rectangle in the user defaults system under a given name.

frameAutosaveName

The name used to automatically save the window’s frame rectangle data in the defaults system.

stringWithSavedFrame

A string representation of the window’s frame rectangle.

setFrameFromString:

Sets the window’s frame rectangle from a given string representation.

Managing Key Status

keyWindow

A Boolean value that indicates whether the window is the key window for the application.

canBecomeKeyWindow

A Boolean value that indicates whether the window can become the key window.

makeKeyWindow

Makes the window the key window.

makeKeyAndOrderFront:

Moves the window to the front of the screen list, within its level, and makes it the key window; that is, it shows the window.

becomeKeyWindow

Invoked automatically to inform the window that it has become the key window; never invoke this method directly.

resignKeyWindow

Invoked automatically when the window resigns key window status; never invoke this method directly.

Managing Main Status

mainWindow

A Boolean value that indicates whether the window is the application’s main window.

canBecomeMainWindow

A Boolean value that indicates whether the window can become the application’s main window.

makeMainWindow

Makes the window the main window.

becomeMainWindow

Invoked automatically to inform the window that it has become the main window; never invoke this method directly.

resignMainWindow

Invoked automatically when the window resigns main window status; never invoke this method directly.

Managing Toolbars

toolbar

The window’s toolbar.

toggleToolbarShown:

The action method for the “Hide Toolbar” menu item (which alternates with “Show Toolbar”).

runToolbarCustomizationPalette:

The action method for the “Customize Toolbar…” menu item.

Managing Attached Windows

childWindows

An array of the window’s attached child windows.

addChildWindow:ordered:

Adds a given window as a child window of the window.

removeChildWindow:

Detaches a given child window from the window.

parentWindow

The parent window to which the window is attached as a child.

Managing Window Buffers

flushWindowDisabled

A Boolean value that indicates whether the window’s flushing ability is disabled.

enableFlushWindow

Reenables the flushWindow method for the window after it was disabled through a previous disableFlushWindow message.

disableFlushWindow

Disables the flushWindow method for the window.

flushWindow

Flushes the window’s offscreen buffer to the screen if the window is buffered and flushing is enabled.

flushWindowIfNeeded

Flushes the window’s offscreen buffer to the screen if flushing is enabled and if the last flushWindow message had no effect because flushing was disabled.

Managing Default Buttons

defaultButtonCell

The button cell that performs as if clicked when the window receives a Return (or Enter) key event.

enableKeyEquivalentForDefaultButtonCell

Reenables the default button cell’s key equivalent, so it performs a click when the user presses Return (or Enter).

disableKeyEquivalentForDefaultButtonCell

Disables the default button cell’s key equivalent, so it doesn’t perform a click when the user presses Return (or Enter).

Managing Field Editors

fieldEditor:forObject:

Returns the window’s field editor, creating it if requested.

endEditingFor:

Forces the field editor to give up its first responder status and prepares it for its next assignment.

Managing the Window Menu

excludedFromWindowsMenu

A Boolean value that indicates whether the window is excluded from the application’s Windows menu.

Managing Cursor Rectangles

areCursorRectsEnabled

A Boolean value that indicates whether the window’s cursor rectangles are enabled.

enableCursorRects

Reenables cursor rectangle management within the window after a disableCursorRects message.

disableCursorRects

Disables all cursor rectangle management within the window.

discardCursorRects

Invalidates all cursor rectangles in the window.

invalidateCursorRectsForView:

Marks as invalid the cursor rectangles of a given NSView object in the window’s view hierarchy, so they’ll be set up again when the window becomes key (or immediately if the window is key).

resetCursorRects

Clears the window’s cursor rectangles and the cursor rectangles of the NSView objects in its view hierarchy.

Managing Title Bars

standardWindowButton:forStyleMask:

Returns a new instance of a given standard window button, sized appropriately for a given window style.

standardWindowButton:

Returns the window button of a given window button kind in the window’s view hierarchy.

showsToolbarButton

A Boolean value that indicates whether the toolbar control button is currently displayed.

titlebarAppearsTransparent

A Boolean value that indicates whether the title bar draws its background.

Managing the Toolbar-Title Bar Area

addTitlebarAccessoryViewController:

Adds the specified title bar accessory view controller to the window.

insertTitlebarAccessoryViewController:atIndex:

Inserts the view controller into the window’s array of title bar accessory view controllers at the specified index.

performWindowDragWithEvent:

Starts a drag based on the specified mouse-down event.

removeTitlebarAccessoryViewControllerAtIndex:

Removes the view controller at the specified index from the window’s array of title bar accessory view controllers.

titlebarAccessoryViewControllers

An array of title bar accessory view controllers that are currently added to the window.

Managing Tooltips

allowsToolTipsWhenApplicationIsInactive

A Boolean value that indicates whether the window can display tooltips even when the application is in the background.

Handling Events

menuChanged:

This method does nothing; it is here for backward compatibility.

Deprecated
currentEvent

The event currently being processed by the application.

nextEventMatchingMask:

Returns the next event matching a given mask.

nextEventMatchingMask:untilDate:inMode:dequeue:

Forwards the message to the global NSApplication object, NSApp.

discardEventsMatchingMask:beforeEvent:

Forwards the message to the NSApplication object, NSApp.

postEvent:atStart:

Forwards the message to the global NSApplication object, NSApp.

sendEvent:

This action method dispatches mouse and keyboard events sent to the window by the NSApplication object.

tryToPerform:with:

Dispatches action messages with a given argument.

Managing Responders

initialFirstResponder

The view that’s made first responder (also called the key view) the first time the window is placed onscreen.

firstResponder

The window’s first responder.

makeFirstResponder:

Attempts to make a given responder the first responder for the window.

Managing the Key View Loop

selectKeyViewPrecedingView:

Makes key the view that precedes the given view.

selectKeyViewFollowingView:

Makes key the view that follows the given view.

selectPreviousKeyView:

This action method searches for a candidate previous key view and, if it finds one, invokes makeFirstResponder: to establish it as the first responder.

selectNextKeyView:

This action method searches for a candidate next key view and, if it finds one, invokes makeFirstResponder: to establish it as the first responder.

keyViewSelectionDirection

The direction the window is currently using to change the key view.

autorecalculatesKeyViewLoop

A Boolean value that indicates whether the window automatically recalculates the key view loop when views are added.

recalculateKeyViewLoop

Marks the key view loop as dirty and in need of recalculation.

Handling Keyboard Events

keyDown:

Handles a given keyboard event that may need to be interpreted as changing the key view or triggering a keyboard equivalent.

Handling Mouse Events

acceptsMouseMovedEvents

A Boolean value that indicates whether the window accepts mouse-moved events.

ignoresMouseEvents

A Boolean value that indicates whether the window is transparent to mouse events.

mouseLocationOutsideOfEventStream

The current location of the pointer reckoned in the window’s base coordinate system, regardless of the current event being handled or of any events pending.

windowNumberAtPoint:belowWindowWithWindowNumber:

Returns the number of the frontmost window that would be hit by a mouse-down at the specified screen location.

trackEventsMatchingMask:timeout:mode:handler:

Tracks events that match the specified mask using the specified tracking handler until the tracking handler explicitly terminates tracking.

Handling Window Restoration

restorable

A Boolean value indicating whether the window configuration is preserved between application launches.

restorationClass

The restoration class associated with the window.

disableSnapshotRestoration

Disable snapshot restoration.

enableSnapshotRestoration

Enable snapshot restoration.

Bracketing Drawing Operations

cacheImageInRect:

Stores the window’s raster image from a given rectangle expressed in the window’s base coordinate system.

Deprecated
restoreCachedImage

Splices the window’s cached image rectangles, if any, back into its raster image (and buffer if it has one), undoing the effect of any drawing performed within those areas since they were established using cacheImageInRect:.

Deprecated
discardCachedImage

Discards all of the window’s cached image rectangles.

Deprecated

Drawing Windows

display

Passes a display message down the window’s view hierarchy, thus redrawing all views within the window, including the frame view that draws the border, title bar, and other peripheral elements.

displayIfNeeded

Passes a displayIfNeeded message down the window’s view hierarchy, thus redrawing all views that need to be displayed, including the frame view that draws the border, title bar, and other peripheral elements.

viewsNeedDisplay

A Boolean value that indicates whether any of the window’s views need to be displayed.

autodisplay

A Boolean value that indicates whether the window automatically displays views that need to be displayed.

useOptimizedDrawing:

Specifies whether the window is to optimize focusing and drawing when displaying its views.

Deprecated
graphicsContext

The graphics context associated with the window for the current thread.

allowsConcurrentViewDrawing

A Boolean value that indicates whether the window allows multithreaded view drawing.

Window Animation

animationBehavior

The window’s automatic animation behavior.

Updating Windows

disableScreenUpdatesUntilFlush

Disables the window’s screen updates until the window is flushed.

update

Updates the window.

Dragging Items

registerForDraggedTypes:

Registers a give set of pasteboard types as the pasteboard types the window will accept as the destination of an image-dragging session.

unregisterDraggedTypes

Unregisters the window as a possible destination for dragging operations.

Accessing Edited Status

documentEdited

A Boolean value that indicates whether the window’s document has been edited.

Converting Coordinates

backingScaleFactor

The backing scale factor.

backingAlignedRect:options:

Returns a backing store pixel aligned rectangle in window coordinates.

convertRectFromBacking:

Converts a rect from its pixel aligned backing store coordinate system to the window’s coordinate system.

convertRectToBacking:

Converts a rectangle from the window’s coordinate system to its pixel aligned backing store coordinate system.

convertRectToScreen:

Converts the rectangle to the screen coordinate system from the window’s coordinate system.

convertRectFromScreen:

Converts the rectangle from the screen coordinate system to the window’s coordinate system

convertBaseToScreen:

Converts a given point from the window’s base coordinate system to the screen coordinate system.

Deprecated
convertScreenToBase:

Converts a given point from the screen coordinate system to the window’s base coordinate system.

Deprecated
userSpaceScaleFactor

Returns the scale factor applied to the window.

Deprecated

Managing Titles

title

The string that appears in the title bar of the window or the path to the represented file.

titleVisibility

A value that indicates the visibility of the window’s title and title bar buttons.

setTitleWithRepresentedFilename:

Sets a given path as the window’s title, formatting it as a file-system path, and records this path as the window’s associated filename using representedFilename.

representedFilename

The path to the file of the window’s represented file.

representedURL

The URL of the file the window represents.

Accessing Screen Information

screen

The screen the window is on.

deepestScreen

The deepest screen the window is on (it may be split over several screens).

displaysWhenScreenProfileChanges

A Boolean value that indicates whether the window context should be updated when the screen profile changes or when the window moves to a different screen.

Moving Windows

movableByWindowBackground

A Boolean value that indicates whether the window is movable by clicking and dragging anywhere in its background.

movable

A Boolean value that indicates whether the window can be dragged by clicking in its title bar or background.

center

Sets the window’s location to the center of the screen.

Closing Windows

performClose:

This action method simulates the user clicking the close button by momentarily highlighting the button and then closing the window.

close

Removes the window from the screen.

releasedWhenClosed

A Boolean value that indicates whether the window is released when it receives the close message.

Minimizing Windows

miniaturized

A Boolean value that indicates whether the window is minimized.

performMiniaturize:

Simulates the user clicking the minimize button by momentarily highlighting the button, then minimizing the window.

miniaturize:

Removes the window from the screen list and displays the minimized window in the Dock.

deminiaturize:

De-minimizes the window.

miniwindowImage

The custom miniaturized window image of the window.

miniwindowTitle

The title displayed in the window’s minimized window.

Getting the Dock Tile

dockTile

The application’s Dock tile.

Printing Windows

print:

This action method runs the Print panel, and if the user chooses an option other than canceling, prints the window (its frame view and all subviews).

dataWithEPSInsideRect:

Returns EPS data that draws the region of the window within a given rectangle.

dataWithPDFInsideRect:

Returns PDF data that draws the region of the window within a given rectangle.

Providing Services

validRequestorForSendType:returnType:

Searches for an object that responds to a Services request.

Triggering Constraint-Based Layout

updateConstraintsIfNeeded

Updates the constraints based on changes to views in the window since the last layout.

layoutIfNeeded

Updates the layout of views in the window based on the current views and constraints.

Debugging Constraint-Based Layout

See Cocoa Auto Layout Release Notes for more details on debugging constraint-based layout.

visualizeConstraints:

Displays a visual representation of the supplied constraints in the window.

Constraint-Based Layouts

anchorAttributeForOrientation:

Returns which part of the window stays stationary during constraint based layout.

setAnchorAttribute:forOrientation:

Sets which part of the window stays stationary during constrain based layout.

Working with Carbon

initWithWindowRef:

Returns a Cocoa window created from a Carbon window.

windowRef

The Carbon WindowRef associated with the window, creating one if necessary.

Working with Window Depths

NSAvailableWindowDepths

Returns the available window depth values.

NSBestDepth

Attempts to return a window depth adequate for the specified parameters.

NSBitsPerPixelFromDepth

Returns the bits per pixel for the specified window depth.

NSBitsPerSampleFromDepth

Returns the bits per sample for the specified window depth.

NSColorSpaceFromDepth

Returns the name of the color space corresponding to the passed window depth.

NSNumberOfColorComponents

Returns the number of color components in the specified color space.

NSPlanarFromDepth

Returns whether the specified window depth is planar.

Constants

NSWindowStyleMask

These constants specify the style of a window, and can be combined using the C bitwise OR operator.

Window Levels

The standard window levels in macOS.

Display Device—Descriptions

These constants are the keys for device description dictionaries used by deviceDescription.

Managing Scaling Factors

Manages scaling factors.

NSSelectionDirection

These constants specify the direction a window is currently using to change the key view. They’re used by keyViewSelectionDirection.

NSWindowButton

These constants provide a way to access standard title bar buttons:

NSWindowDepth

This type represents the depth, or amount of memory, devoted to a single pixel in a window or screen. A depth of 0 indicates default depth. Window depths should not be made persistent as they will not be the same across systems.

NSBackingStoreType

These constants specify how the drawing done in a window is buffered by the window device.

NSWindowOrderingMode

These constants let you specify how a window is ordered relative to another window. For more information, see orderWindow:relativeTo:.

NSWindowSharingType

The following constants and the related data type represent the access levels other processes can have to a window’s content.

NSWindowBackingLocation

The following constants and the related data type represent a window’s possible backing locations.

NSWindowNumberListOptions

The options that may be passed to the windowNumbersWithOptions: method.

NSWindowAnimationBehavior

These constants control the automatic window animation behavior used when the orderFront: or orderOut: methods are called.

NSWindowCollectionBehavior

Window collection behaviors related to Exposé and Spaces.

NSWindowOcclusionState

Specifies whether the window is occluded.

NSWindowTitleVisibility

Specifies the appearance of the window’s title bar area.

Application Kit Version for Deferred Window Display Support

The version of the AppKit.framework containing a specific bug fix or capability.

Application Kit Version for Custom Sheet Position

The version of the AppKit.framework containing a specific bug fix or capability.

Notifications

NSWindowDidBecomeKeyNotification

Posted whenever an NSWindow object becomes the key window.

NSWindowDidBecomeMainNotification

Posted whenever an NSWindow object becomes the main window.

NSWindowDidChangeScreenNotification

Posted whenever a portion of an NSWindow object’s frame moves onto or off of a screen.

NSWindowDidChangeScreenProfileNotification

Posted whenever the display profile for the screen containing the window changes.

NSWindowDidDeminiaturizeNotification

Posted whenever an NSWindow object is deminimized.

NSWindowDidEndSheetNotification

Posted whenever an NSWindow object closes an attached sheet.

NSWindowDidEndLiveResizeNotification

Posted after the user resizes a window.

NSWindowDidExposeNotification

Posted whenever a portion of a nonretained NSWindow object is exposed, whether by being ordered in front of other windows or by other windows being removed from in front of it.

NSWindowDidMiniaturizeNotification

Posted whenever an NSWindow object is minimized.

NSWindowDidMoveNotification

Posted whenever an NSWindow object is moved.

NSWindowDidResignKeyNotification

Posted whenever an NSWindow object resigns its status as key window.

NSWindowDidResignMainNotification

Posted whenever an NSWindow object resigns its status as main window.

NSWindowDidResizeNotification

Posted whenever an NSWindow object’s size changes.

NSWindowDidUpdateNotification

Posted whenever an NSWindow object receives an update message.

NSWindowWillBeginSheetNotification

Posted whenever an NSWindow object is about to open a sheet.

NSWindowWillCloseNotification

Posted whenever an NSWindow object is about to close.

NSWindowWillMiniaturizeNotification

Posted whenever an NSWindow object is about to be minimized.

NSWindowWillMoveNotification

Posted whenever an NSWindow object is about to move.

NSWindowWillStartLiveResizeNotification

Posted before the user resizes a window.

NSWindowWillEnterFullScreenNotification

Posted when the window will enter full screen mode.

NSWindowDidEnterFullScreenNotification

Posted when the window entered full screen mode.

NSWindowWillExitFullScreenNotification

Posted when the window will exit full screen mode.

NSWindowDidExitFullScreenNotification

Posted when the window did exit full screen mode.

NSWindowWillEnterVersionBrowserNotification

Posted when the window will enter version browser mode.

NSWindowDidEnterVersionBrowserNotification

Posted when the window will enter version browser mode.

NSWindowWillExitVersionBrowserNotification

Posted when the window will exit version browser mode.

NSWindowDidExitVersionBrowserNotification

Posted when the window did exit version browser mode.

NSWindowDidChangeBackingPropertiesNotification

Posted when the window backing properties change.

NSWindowDidChangeOcclusionStateNotification

Posted when the window’s occlusion state changes.

Instance Properties

hasCloseBox

Returns YES if the receiver has a close box.

hasTitleBar

Returns YES if the receiver has a title bar.

orderedIndex

Sets the zero-based position of the receiver, based on its order from front to back among all visible application windows, to the value specified by index. If index is out of range, sets the position to the nearest value that is in range.

Instance Methods

handleCloseScriptCommand:

Handles the close AppleScript command by attempting to close the window (and its associated document, if any).

handlePrintScriptCommand:

Handles the print AppleScript command by attempting to print the contents of the window (or its associated document, if any).

handleSaveScriptCommand:

Handles the save AppleScript command by attempting to save the window (and its associated document, if any).

setIsMiniaturized:

Sets the receiver’s miniaturized state to the value specified by flag.

setIsVisible:

Sets the receiver’s visible state to the value specified by flag.

setIsZoomed:

Sets the receiver’s zoomed state to the value specified by flag.

See Also

Windows

NSPanel

A special kind of window that typically performs a function that is auxiliary to the main window.

NSWindowDelegate

A set of optional methods that a delegate of NSWindow can implement to respond to events, such as window resizing, moving, exposing, and minimizing.

Tabbed Windows

Support tabbed windows in your app.

NSWindowScripting

A set of methods that supports window scripting for all scriptable Cocoa apps.

NSLayerDelegateContentsScaleUpdating

A protocol that defines an optional CALayer delegate method for handling resolution changes.