---
title: "setFrame(_:display:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nswindow/setframe(_:display:)"
---

# setFrame(_:display:)

Sets the origin and size of the window’s frame rectangle according to a given frame rectangle, thereby setting its position and size onscreen.

## Declaration

```swift
func setFrame(_ frameRect: NSRect, display flag: Bool)
```

## Parameters

- `frameRect`: The frame rectangle for the window, including the title bar.
- `flag`: Specifies whether the window redraws the views that need to be displayed. When doc://com.apple.documentation/documentation/Swift/true the window sends a doc://com.apple.appkit/documentation/AppKit/NSWindow/displayIfNeeded() message down its view hierarchy, thus redrawing all views.

## Discussion

Discussion Note that the window server limits window position coordinates to ±16,000 and sizes to 10,000.

## See Also

### Related Documentation

- [setFrame(from:)](appkit/nswindow/setframe(from:).md)
- [frameRect(forContentRect:styleMask:)](appkit/nswindow/framerect(forcontentrect:stylemask:).md)
- [setFrameUsingName(_:)](appkit/nswindow/setframeusingname(_:).md)

### Sizing Windows

- [frame](appkit/nswindow/frame.md)
- [setFrameOrigin(_:)](appkit/nswindow/setframeorigin(_:).md)
- [setFrameTopLeftPoint(_:)](appkit/nswindow/setframetopleftpoint(_:).md)
- [constrainFrameRect(_:to:)](appkit/nswindow/constrainframerect(_:to:).md)
- [cascadeTopLeft(from:)](appkit/nswindow/cascadetopleft(from:).md)
- [setFrame(_:display:animate:)](appkit/nswindow/setframe(_:display:animate:).md)
- [animationResizeTime(_:)](appkit/nswindow/animationresizetime(_:).md)
- [aspectRatio](appkit/nswindow/aspectratio.md)
- [minSize](appkit/nswindow/minsize.md)
- [maxSize](appkit/nswindow/maxsize.md)
- [isZoomed](appkit/nswindow/iszoomed.md)
- [performZoom(_:)](appkit/nswindow/performzoom(_:).md)
- [zoom(_:)](appkit/nswindow/zoom(_:).md)
- [resizeFlags](appkit/nswindow/resizeflags.md)
- [resizeIncrements](appkit/nswindow/resizeincrements.md)
