Questions about [NSApplication run]
Questions about [NSApplication run]
- Subject: Questions about [NSApplication run]
- From: "Slava Pestov" <email@hidden>
- Date: Thu, 4 Dec 2008 23:53:04 -0600
Hi everybody,
For various reasons, my Cocoa app runs its own event loop instead of
using [NSApplication run]. What I do is roughly the following, in a
loop:
e = [self nextEventMatchingMask: NSAnyEventMask
untilDate: [NSDate distantFuture]
inMode: NSDefaultRunLoopMode
dequeue: YES];
if (e)
[self sendEvent: e];
... more logic ...
This works fine except for one issue; when switching between windows
using Expose, clicking on one of my app's windows doesn't always bring
it to the front.
Is there something magical that [NSApplication run] does which my app
is not doing?
The documentation for [NSApplication run] does suggest that it is ok
to override it, and from this I inferred that the logic is simple
enough that one can duplicate it. Is this information out of date?
Have newer OS X features made it necessary to handle events by calling
[NSApplication run]?
Slava
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden