Re: how to run NSApplicationMain() in child process?
Re: how to run NSApplicationMain() in child process?
- Subject: Re: how to run NSApplicationMain() in child process?
- From: Jens Alfke <email@hidden>
- Date: Fri, 10 May 2013 12:03:17 -0700
On May 9, 2013, at 11:56 PM, Ondrej Holecek <email@hidden> wrote:
> No, the "daemon" is the picture viewer itself. It is hidden most of
> the time.
That doesn’t sound like a daemon or an agent; those types of things run in the background with no UI. Once there’s a UI, you are writing a regular app. If you don’t want it to “feel” like a full app, with a Dock icon and menu bar, what you’re looking for is the “LSUIElement” key in the app’s Info.plist — this tells the OS that the app just wants to display windows and nothing else. (For example, this is how the Special Characters palette is implemented.)
> When you run "xqiv image1.jpg image2.jpg" from command-line,
> then the "daemon" pops and displays image1.jpg.
All you need is to make an app, maybe with the LSUIElement flag as I said above. Let’s say its bundle ID is com.example.XQIVApp. Then you can implement the ‘xqiv’ command-line tool as a trivial shellscript:
#!/bin/sh
open -b com.example.XQIVApp $@
—Jens
_______________________________________________
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