---
title: "contentRect(forFrameRect:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nswindow/contentrect(forframerect:)"
---

# contentRect(forFrameRect:)

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

## Declaration

```swift
func contentRect(forFrameRect frameRect: NSRect) -> NSRect
```

## Parameters

- `frameRect`: The frame rectangle for the window expressed in screen coordinates.

## Return Value

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

## Discussion

Discussion The window uses its current style mask in computing the content rectangle. See NSWindow.StyleMask for a list of style mask values. The main advantage of this instance-method counterpart to contentRect(forFrameRect: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

- [contentRect(forFrameRect:styleMask:)](appkit/nswindow/contentrect(forframerect:stylemask:).md)
- [frameRect(forContentRect:styleMask:)](appkit/nswindow/framerect(forcontentrect:stylemask:).md)
- [minFrameWidth(withTitle:styleMask:)](appkit/nswindow/minframewidth(withtitle:stylemask:).md)
- [frameRect(forContentRect:)](appkit/nswindow/framerect(forcontentrect:).md)
