<!--
{
  "availability" : [
    "macOS: 10.5.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSPathControlDelegate/pathControl(_:willDisplay:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSPathControlDelegate(im)pathControl:willDisplayOpenPanel:"
  },
  "title" : "pathControl(_:willDisplay:)"
}
-->

# pathControl(_:willDisplay:)

Implement this method to customize the Open panel shown by a pop-up–style path.

```
@MainActor optional func pathControl(_ pathControl: NSPathControl, willDisplay openPanel: NSOpenPanel)
```

## Parameters

`pathControl`

The path control displaying the Open panel.

`openPanel`

The Open panel to be displayed.

## Discussion

This method is called before the Open panel is shown but after its allowed file types are set to the cell’s allowed types. At this time, you can further customize the Open panel as required. This method is called only when the style is set to `NSPathStylePopUp`. Implementation of this method is optional.

---

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)