<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSPopUpButton/init(frame:pullsDown:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSPopUpButton(im)initWithFrame:pullsDown:"
  },
  "title" : "init(frame:pullsDown:)"
}
-->

# init(frame:pullsDown:)

Returns an `NSPopUpButton` object initialized to the specified dimensions.

```
init(frame buttonFrame: NSRect, pullsDown flag: Bool)
```

## Parameters

`buttonFrame`

The frame rectangle for the button, specified in the parent view’s coordinate system.

`flag`

<doc://com.apple.documentation/documentation/Swift/true> if you want the receiver to display a pull-down menu; otherwise, <doc://com.apple.documentation/documentation/Swift/false> if you want it to display a pop-up menu.

## Return Value

An initialized `NSPopUpButton` object, or `nil` if the object could not be initialized.

## See Also

[`-  initTextCell:pullsDown:`](/documentation/AppKit/NSPopUpButtonCell/init(textCell:pullsDown:))

Returns an `NSPopUpButtonCell` object initialized with the specified title.

[`pullsDown`](/documentation/AppKit/NSPopUpButton/pullsDown)

A Boolean value indicating whether the button displays a pull-down or pop-up menu.



---

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)