On Fri, Dec 5, 2008 at 12:53 AM, Slava Pestov <[EMAIL PROTECTED]> wrote:
> 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?

I'm afraid I don't know the answer to your question, but can I ask why
you're doing this in the first place? If you just need to run some
custom code every time through the event loop,
NSApplicationDidUpdateNotification or CFRunLoopObserver will do it for
you.

Mike
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to