Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Apr 2, 2011, 04:12 AM   #1
geoldr
macrumors newbie
 
Join Date: Apr 2011
Help with running in background

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?
geoldr is offline   0 Reply With Quote
Old Apr 2, 2011, 12:28 PM   #2
kainjow
Moderator emeritus
 
kainjow's Avatar
 
Join Date: Jun 2000
You probably need to make your app the frontmost:

Code:
[NSApp activateIgnoringOtherApps:YES];
kainjow is offline   0 Reply With Quote
Old Apr 2, 2011, 07:24 PM   #3
geoldr
Thread Starter
macrumors newbie
 
Join Date: Apr 2011
Ok cool thank you, you pointed me in the right direction. I used this code
Code:
[NSApp activateIgnoringOtherApps: YES];
[window makeKeyAndOrderFront: self];
geoldr is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
running videos in background? eclipse01 iOS 7 0 Sep 30, 2013 12:36 PM
Kill running apps in background NJFP iOS 7 7 Sep 18, 2013 06:07 PM
Keeping an application running in the background tcurtist Mac Basics and Help 0 Jan 18, 2013 03:24 PM
How to tell if apps are running in the background chele519 iPhone 17 Sep 26, 2012 09:13 PM
Messages always running in background? stark4 OS X 10.8 Mountain Lion 4 Aug 22, 2012 12:03 PM

Forum Jump

All times are GMT -5. The time now is 05:47 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC