Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: activateIgnoringOtherApps



On Aug 31, 2008, at 8:48 AM, Chris Idou wrote:

I want to pop up a window in response to a hot key. So I'm creating a window, setting it makeKeyAndOrderFront, and I'm calling [NSApp activateIgnoringOtherApps] so that it gets focus.

The thing is, activateIgnoringOtherApps seems to bring ALL my app's windows in front of other windows (my app has other windows), whereas all I want is to pop up my new window in front of the currently active application without affecting the order of my app's other windows, and leaving the previously active app to be second to top.

Has anyone got any idea how to achieve that?

You can use SetFrontProcessWithOptions with kSetFrontProcessFrontWindowOnly.


On the other hand, you should generally avoid bringing your application to the front except in response to user action/request. Ideally, the order of applications and windows is for the user to decide.

If you need the user's attention, you can use NSAlert or - [NSApplication requestUserAttention:]. (I believe the former uses the latter.)

Cheers,
Ken
_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >activateIgnoringOtherApps (From: Chris Idou <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.