Re: Window from Shell Application
Re: Window from Shell Application
- Subject: Re: Window from Shell Application
- From: Steve Majewski <email@hidden>
- Date: Wed, 28 Feb 2007 16:06:35 -0500
On Feb 27, 2007, at 11:46 PM, Rick Langschultz wrote:
Are there any examples out there to display a regular window from a
BSD-like Cocoa Shell tool?
I am looking to use a nib file only when my app needs to display
items in a NSTextField, etc. most of the other stuff is done inside
a shell like tool.
Rick Langschultz
email@hidden
If you need to do something like that, it may be easier to do with
Carbon libraries
( which may also give you a little more control over the event loop. )
Cocoa is a framework, not just a library, and it's very awkward to
use outside of
the framework. In particular, it expects to have a certain context
which means
(among other things) that it's running from a bundle, not just from a
'naked'
binary executable file. There are some Cocoa routines that will just
inexplicably
fail if you try to call them from a non-bundle/non-framework naked
executable.
You might look at how python handles this: the executable in /usr/bin
is really
a link to an executable in /System/Library/Frameworks/
Python.framework, so you
can use the pyobjc routines to open a window, etc.
If all you want is for your command-line app to open a dialog box
with some
fields to fill in, I would probably avoid Cocoa and use Carbon. ( Or
maybe
even better: get it to use the browser as an interface. ) If it's a
larger
app with a lot more user interface code required, then I'ld probably
go with
Cocoa -- but consider if you can invert the dependency here: maybe
you should
make a Cocoa app than includes a command-line interface within it.
-- Steve Majewski
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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