---
title: "frameRect(forContentRect:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nswindow/framerect(forcontentrect:)"
---

# frameRect(forContentRect:)

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

## Declaration

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

## Parameters

- `contentRect`: The content rectangle for the window expressed in screen coordinates.

## Return Value

Return Value The window’s frame rectangle, expressed in screen coordinates, with contentRect.

## Discussion

Discussion The window uses its current style mask in computing the frame rectangle. See NSWindow.StyleMask for a list of style mask values. The major advantage of this instance-method counterpart to frameRect(forContentRect:styleMask:) is that it allows you to take toolbars into account when converting between content and frame rectangles. (The toolbar is included in the frame rectangle but not 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)
- [contentRect(forFrameRect:)](appkit/nswindow/contentrect(forframerect:).md)
