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

# postEvent(_:atStart:)

Forwards the message to the global application object.

```
func postEvent(_ event: NSEvent, atStart flag: Bool)
```

## Parameters

`event`

The event to add to the window’s event queue.

`flag`

<doc://com.apple.documentation/documentation/Swift/true> to place the event in the front of the queue; <doc://com.apple.documentation/documentation/Swift/false> to place it in the back.

## See Also

[`postEvent(_:atStart:)`](/documentation/AppKit/NSApplication/postEvent(_:atStart:))

Adds a given event to the receiver’s event queue.



---

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)