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

# frameRect(forContentRect:styleMask:)

Returns the frame rectangle used by a window with a given content rectangle and window style.

## Declaration

```swift
class func frameRect(forContentRect cRect: NSRect, styleMask style: NSWindow.StyleMask) -> NSRect
```

## Parameters

- `cRect`: The content rectangle for a window expressed in screen coordinates.
- `style`: The window style for the window. See doc://com.apple.appkit/documentation/AppKit/NSWindow/StyleMask-swift.struct for a list of style mask values.

## Return Value

Return Value The frame rectangle, expressed in screen coordinates, used by the window with cRect and style.

## Discussion

Discussion When a NSWindow instance is available, you should use frameRect(forContentRect:) instead of this method.

## See Also

### Getting Layout Information

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