Giving a CLI app an Aqua window - how easy?

willmac

Registered
Hya, I have a small CLI app that I have written for my work. Is it possible using Apple's Developer Tools to make it launch and operate within a single Finder window? If so could somebody point me in the direction of some instructions.

Thanks in advance

will
 
What's CLI?

What source code is it written in? If it's compatible with one of the languages in Project Builder, use Interface Builder to create the interface.
 
CLI = Command Line Interface, so basically it's a console app, and I'm guessing it's written in C/C++?

Probably the easiest thing to do is port it into a GUI app. Take Project Builder and start a new Cocoa app project. Objective-C is a superset of C so if your CLI app was written in C you can make the same calls to the C runtime library mixed in Objective-C code. Same goes for C++. That are articles (try www.macdevcenter) that discuss how to mix these languages. But the idea is to take the existing code and inject it into a GUI framework code.
 
its also pretty easy to write applescript to do this. While apple script will not allow real-time control of a cli app, it is an extremely easy way to allow non-cli users to use a cli application.

At any rate, its probably easier than compiling your code into a cocoa app.
 
Oh, and if you would like to see this in action, a front end to 'nmap' (cli port scanning tool) written in applescript is avaliable on my site:
http://lfnet.net/index-old.html

I no longer maintain it, but there's enough code there for you to see how this is done.
 
Developer/Documentation/Darwin/GettingStarted/PortingUNIX/PortingUNIXToOSX.pdf partially addresses this issue. Other tutorials and docoumentation on InterfaceBuilder and ProjectBuilder are available in the Documentation directory and online at developer.apple.com
 
I found this odd... Where did the your signature go?
 

Attachments

  • odd.gif
    odd.gif
    17.5 KB · Views: 9
Thanks for all of you're advice. First of all, apologies for the lack of detail in my post. Yes the app does run in the console and it has been written in C++. Will have a look at the InterfaceBuilder and ProjectBuilder docs and take it from there.

Thanks again

will
 
Back
Top