Re: launchApplication and window deselection
Re: launchApplication and window deselection
- Subject: Re: launchApplication and window deselection
- From: email@hidden
- Date: Wed, 27 Feb 2002 20:03:15 -0800
I don't think is a bug. I've never used launchApplication: before, but
it is reasonable that when you launch an application, it gets the
focus.
If the background app doesn't have UI, what about using a command line
one?
But if the app already tells the system that it doesn't have a UI...
And there is no command line interface. This app is just like a classic
faceless background application.
You're assuming not only that the API makes sense and does something
entirely logical, but that the doc is well-written and properly
represents what's going on. :->
The problem is what app is considered active, not what window is
key. Try [NSApp activateIgnoringOtherApps:YES];. You might be able
to do this synchronously, or you might have to wait until you receive
the NSWorkspaceDidLaunchApplicationNotification.
This approached did the trick. The key seems to be the
activateIgnoringOtherApps method.
Although you're probably deactivating and reactiving, causing a
flicker... no?
For some reason NSWorkspaceDidLaunchApplicationNotification didn't come
through after launch. I added my own private notification and it
synchronized nicely.
I also had to make my main window key (though the menus work without
doing this).
Interesting. Well, glad I could help.
I hope you logged a bug on Apple that a deactivate: parameter on
launchApplication: would be a welcome addition...
Ben Haller
Stick Software
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.