Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

geoldr

macrumors newbie
Original poster
Apr 1, 2011
17
0
Hello, so I have created an application that uses the
"Application is background only" plist variable to run my program without a menu bar or dock icon. I have created an NSStatusMenu, and when i click that my main window opens. I am having a problem, however, with the program displaying behind other windows. So if I run my program from xcode, and open the window by clicking the icon in the menu, it will pop up behind xcode, and I have to move xcode to see it. I am sure there has to be a way to make it show it show up on top. Does anybody have a way to do this?
 
You probably need to make your app the frontmost:

Code:
[NSApp activateIgnoringOtherApps:YES];
 
Ok cool thank you, you pointed me in the right direction. I used this code
Code:
[NSApp activateIgnoringOtherApps: YES];
[window makeKeyAndOrderFront: self];
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.