App Windows

Show, hide, minimize, arrange, and update your app's windows.

Topics

Managing App Windows

keyWindow

The window that currently receives keyboard events.

mainWindow

The app’s main window.

- windowWithWindowNumber:

Returns the window corresponding to the specified window number.

windows

An array of the app’s window objects.

- makeWindowsPerform:inOrder:

Sends the specified message to each of the app’s window objects until one returns a non-nil value.

Deprecated
- enumerateWindowsWithOptions:usingBlock:

Executes a block for each of the app's windows.

NSWindowListOptions

This constant indicates a window ordering.

Minimizing Windows

- miniaturizeAll:

Miniaturizes all the receiver’s windows.

Hiding Windows

hidden

A Boolean value indicating whether the app is hidden.

- hide:

Hides all the receiver’s windows, and the next app in line is activated.

- unhide:

Restores hidden windows to the screen and makes the receiver active.

- unhideWithoutActivation

Restores hidden windows without activating their owner (the receiver).

Updating Windows

- updateWindows

Sends an update message to each onscreen window.

- setWindowsNeedUpdate:

Sets whether the receiver’s windows need updating when the receiver has finished processing the current event.

Managing Window Layers

- preventWindowOrdering

Suppresses the usual window ordering in handling the most recent mouse-down event.

- arrangeInFront:

Arranges windows listed in the Window menu in front of all other windows.

Drawing Windows

context

The graphics context associated with the app.

Deprecated

Getting the Occlusion State

occlusionState

The occlusion state of the app.

NSApplicationOcclusionState

This constant indicates whether at least part of any window owned by this app is visible.

Restoring App Windows at Launch

- extendStateRestoration

Allows an app to extend its state restoration period.

- completeStateRestoration

Completes the extended state restoration.

- restoreWindowWithIdentifier:state:completionHandler:

Invoked to request that a window be restored.

Managing Run Loops

NSDisplayWindowRunLoopOrdering

The priority at which windows are displayed.

NSResetCursorRectsRunLoopOrdering

The priority at which cursor rects are reset.

See Also

Managing Windows, Panels, and Menus

Modal Windows and Panels

Display a modal window or show one of the standard app panels, such as the app's About panel.