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 (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