• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: activateIgnoringOtherApps
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: activateIgnoringOtherApps


  • Subject: Re: activateIgnoringOtherApps
  • From: Ken Thomases <email@hidden>
  • Date: Sun, 31 Aug 2008 16:05:52 -0500

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:
This email sent to email@hidden


  • Follow-Ups:
    • Re: activateIgnoringOtherApps
      • From: Chris Idou <email@hidden>
References: 
 >activateIgnoringOtherApps (From: Chris Idou <email@hidden>)

  • Prev by Date: Re: Sending a GET or POST HTTP request with Cocoa
  • Next by Date: Re: App names
  • Previous by thread: activateIgnoringOtherApps
  • Next by thread: Re: activateIgnoringOtherApps
  • Index(es):
    • Date
    • Thread