---
title: "postEvent(_:atStart:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nswindow/postevent(_:atstart:)"
---

# postEvent(_:atStart:)

Forwards the message to the global application object.

## Declaration

```swift
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

### Related Documentation

- [postEvent(_:atStart:)](appkit/nsapplication/postevent(_:atstart:).md)

### Handling Events

- [currentEvent](appkit/nswindow/currentevent.md)
- [nextEvent(matching:)](appkit/nswindow/nextevent(matching:).md)
- [nextEvent(matching:until:inMode:dequeue:)](appkit/nswindow/nextevent(matching:until:inmode:dequeue:).md)
- [discardEvents(matching:before:)](appkit/nswindow/discardevents(matching:before:).md)
- [sendEvent(_:)](appkit/nswindow/sendevent(_:).md)
- [tryToPerform(_:with:)](appkit/nswindow/trytoperform(_:with:).md)
