C.BOOL(C.YES))// wait so we can properly drain the autorelease pool; on other platforms we wind up waiting anyway (since the main thread can only handle one thing at a time) so
// -[NSApplication stop:] stops the event loop; it won't do a clean termination, but we're not too concerned with that (at least not on the other platforms either so)
// we can't call -[NSApplication terminate:] because that will just quit the program, ensuring we never leave ui.Go()
C.objc_msgSend_id(NSApp,_stop,NSApp)
// simply calling -[NSApplication stop:] is not good enough, as the stop flag is only checked when an event comes in
// we have to create a "proper" event; a blank event will just throw an exception
C.objc_msgSend_id_bool(NSApp,
_postEventAtStart,
C.makeDummyEvent(),
C.BOOL(C.NO))// not at start, just in case there are other events pending (TODO is this correct?)
err=fmt.Errorf("error setting NSApplication activation policy (basically identifies our program as a separate program; needed for several things, such as Dock icon, application menu, window resizing, etc.) (unknown reason)")
C.objc_msgSend_bool(NSApp,_activateIgnoringOtherApps,C.BOOL(C.YES))// TODO actually do C.NO here? Russ Cox does YES in his devdraw; the docs say the Finder does NO