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

# contentRect(forFrameRect:styleMask:)

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

## Declaration

```swift
class func contentRect(forFrameRect fRect: NSRect, styleMask style: NSWindow.StyleMask) -> NSRect
```

## Parameters

- `fRect`: The frame rectangle for the 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 content rectangle, expressed in screen coordinates, used by the window with fRect and style.

## Discussion

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

## See Also

### Getting Layout Information

- [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)
- [frameRect(forContentRect:)](appkit/nswindow/framerect(forcontentrect:).md)
