Instance Method

beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:

Starts a document modal session.

Declaration

- (void)beginSheet:(NSWindow *)sheet modalForWindow:(NSWindow *)docWindow modalDelegate:(id)modalDelegate didEndSelector:(SEL)didEndSelector contextInfo:(void *)contextInfo;

Parameters

sheet

The window object representing the sheet you want to display.

docWindow

The window object to which you want to attach the sheet.

modalDelegate

The delegate object that defines your didEndSelector method. If nil, the method in didEndSelector is not called.

didEndSelector

An optional method to call when the sheet’s modal session has ended. This method must be defined on the object in the modalDelegate parameter and have the following signature:

- (void)sheetDidEnd:(NSWindow *)sheet returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo;
contextInfo

A pointer to the context info you want passed to the didEndSelector method when the sheet’s modal session ends.

Discussion

This method displays the sheet modally on the specified window and returns control to the caller. Most events targeted at docWindow are prohibited while the sheet is displayed but the app’s main run loop runs normally otherwise.

See Also

Deprecated

- endModalSession:

Finishes a modal session.

- endSheet:

Ends a document modal session by specifying the sheet window.

Deprecated
- endSheet:returnCode:

Ends a document modal session by specifying the sheet window.

Deprecated