Modal Windows and Panels

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


Running a Modal Window

- runModalForWindow:

Starts a modal event loop for the specified window.

- stopModal

Stops a modal event loop.

- stopModalWithCode:

Stops a modal event loop, allowing you to return a custom result code.

- abortModal

Aborts the event loop started by runModalForWindow: or runModalSession:.

- beginModalSessionForWindow:

Sets up a modal session with the given window and returns a pointer to the NSModalSession structure representing the session.

- runModalSession:

Runs a given modal session, as defined in a previous invocation of beginModalSessionForWindow:.


The modal window displayed by the app.


A set of button return values for modal dialogs.


Variables of type NSModalSession point to information used by the system between NSApplication’s beginModalSessionForWindow: and endModalSession: messages.


A run loop should be set to this mode when waiting for input from a modal panel, such as NSSavePanel or NSOpenPanel.

Managing Panels

- orderFrontColorPanel:

Brings up the color panel, an instance of NSColorPanel.

- orderFrontStandardAboutPanel:

Displays a standard About window.

- orderFrontStandardAboutPanelWithOptions:

Displays a standard About window with information from a given options dictionary.

- orderFrontCharacterPalette:

Opens the character palette.

- runPageLayout:

Displays the receiver’s page layout panel, an instance of NSPageLayout.


Keys to include in the options dictionary when displaying an About panel.

See Also

Managing Windows, Panels, and Menus

App Windows

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


Access the app's main menu items and update the window and services menus.