Instance Method

contentRectForFrameRect:

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

Declaration

- (NSRect)contentRectForFrameRect:(NSRect)frameRect;

Parameters

frameRect

The frame rectangle for the window expressed in screen coordinates.

Return Value

The window’s content rectangle, expressed in screen coordinates, with frameRect.

Discussion

The window uses its current style mask in computing the content rectangle. See NSWindowStyleMask for a list of style mask values. The main advantage of this instance-method counterpart to contentRectForFrameRect:styleMask: is that it allows you to take toolbars into account when converting between content and frame rectangles. (The toolbar is not included in the content rectangle.)

See Also

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.

- frameRectForContentRect:

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