<!--
{
  "availability" : [
    "macOS: 10.12.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSResponder/newWindowForTab(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSResponder(im)newWindowForTab:"
  },
  "title" : "newWindowForTab(_:)"
}
-->

# newWindowForTab(_:)

Creates a new window to show as a tab in a tabbed window.

```
@IBAction func newWindowForTab(_ sender: Any?)
```

## Parameters

`sender`

The sender of the action.

## Discussion

The system automatically calls this method to create a window for a new tab when the user clicks the plus button in a tabbed window. The system shows a plus button on a tabbed window only if this method exists on one of the following objects:

- In an [`NSDocumentController`](/documentation/AppKit/NSDocumentController) subclass
- In the responder chain starting at [`NSWindow`](/documentation/AppKit/NSWindow), such as [`NSWindow`](/documentation/AppKit/NSWindow), the window delegate, the window controller, the [`NSApplication`](/documentation/AppKit/NSApplication) delegate, and so on

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)